String: Improve overflow test coverage for strnlen

This patch adds more overflow test coverage for strnlen and wcsnlen.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
This commit is contained in:
Sunil K Pandey 2022-05-25 13:43:36 -07:00
parent 3d9926663c
commit 7597b251d4

View File

@ -96,6 +96,8 @@ do_overflow_tests (void)
for (i = 0; i < 750; ++i)
{
do_test (1, i, SIZE_MAX, BIG_CHAR);
do_test (0, i, SIZE_MAX - i, BIG_CHAR);
do_test (0, i, i - buf_addr, BIG_CHAR);
do_test (0, i, -buf_addr - i, BIG_CHAR);