diff options
author | Noah Goldstein <goldstein.w.n@gmail.com> | 2021-06-23 19:17:29 -0400 |
---|---|---|
committer | Noah Goldstein <goldstein.w.n@gmail.com> | 2021-06-24 19:14:15 -0400 |
commit | bd3a2b3ed18fdeff0b370110c35850b51d025e8c (patch) | |
tree | b51b2e0cae9838cbf186f4f14072257c9788d070 /string/test-strnlen.c | |
parent | 9f70985569888d68612012fcb538c47c154c1e8b (diff) | |
download | glibc-bd3a2b3ed18fdeff0b370110c35850b51d025e8c.zip glibc-bd3a2b3ed18fdeff0b370110c35850b51d025e8c.tar.gz glibc-bd3a2b3ed18fdeff0b370110c35850b51d025e8c.tar.bz2 |
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>
Diffstat (limited to 'string/test-strnlen.c')
-rw-r--r-- | string/test-strnlen.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/string/test-strnlen.c b/string/test-strnlen.c index f53e092..bb5d9b5 100644 --- a/string/test-strnlen.c +++ b/string/test-strnlen.c @@ -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); } } } |