about summary refs log tree commit diff
path: root/string
diff options
context:
space:
mode:
authorSunil K Pandey <skpgkp2@gmail.com>2022-05-25 13:43:36 -0700
committerSunil K Pandey <skpgkp2@gmail.com>2022-05-25 14:23:54 -0700
commit7597b251d451fa099686344bbd9915bd481ba55b (patch)
tree117a5daa347bd804554ded3cf07fc50301b3f0b2 /string
parent3d9926663cba19f40d26d8a8ab3b2a7cc09ffb13 (diff)
downloadglibc-7597b251d451fa099686344bbd9915bd481ba55b.tar.gz
glibc-7597b251d451fa099686344bbd9915bd481ba55b.tar.xz
glibc-7597b251d451fa099686344bbd9915bd481ba55b.zip
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>
Diffstat (limited to 'string')
-rw-r--r--string/test-strnlen.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/string/test-strnlen.c b/string/test-strnlen.c
index 83c4502b9a..4a9375112a 100644
--- a/string/test-strnlen.c
+++ b/string/test-strnlen.c
@@ -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);