String: Add three more overflow tests cases to test-strnlen.c

No bug. Just seem like relevant cases given that strnlen will
use s + maxlen in many implementations.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
This commit is contained in:
Noah Goldstein 2021-06-23 19:17:29 -04:00
parent 9f70985569
commit bd3a2b3ed1

View File

@ -117,6 +117,10 @@ do_overflow_tests (void)
do_test (0, i, ~len + i, BIG_CHAR);
do_test (0, i, ~len - buf_addr - i, BIG_CHAR);
do_test (0, i, ~len - buf_addr + i, BIG_CHAR);
do_test (0, i, -buf_addr, BIG_CHAR);
do_test (0, i, j - buf_addr, BIG_CHAR);
do_test (0, i, -buf_addr - j, BIG_CHAR);
}
}
}