]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
String: Improve overflow test coverage for strnlen
authorSunil K Pandey <skpgkp2@gmail.com>
Wed, 25 May 2022 20:43:36 +0000 (13:43 -0700)
committerSunil K Pandey <skpgkp2@gmail.com>
Wed, 25 May 2022 21:23:54 +0000 (14:23 -0700)
This patch adds more overflow test coverage for strnlen and wcsnlen.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
string/test-strnlen.c

index 83c4502b9ab2505810488a42655dd98ec2a17d17..4a9375112add204fa6466176ee18395ba42794ac 100644 (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);