public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] String: Add three more overflow tests cases to test-strnlen.c
@ 2021-06-24 23:41 Noah Goldstein
  0 siblings, 0 replies; only message in thread
From: Noah Goldstein @ 2021-06-24 23:41 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bd3a2b3ed18fdeff0b370110c35850b51d025e8c

commit bd3a2b3ed18fdeff0b370110c35850b51d025e8c
Author: Noah Goldstein <goldstein.w.n@gmail.com>
Date:   Wed Jun 23 19:17:29 2021 -0400

    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>

Diff:
---
 string/test-strnlen.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/string/test-strnlen.c b/string/test-strnlen.c
index f53e09263f..bb5d9b5f04 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);
         }
     }
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-24 23:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-24 23:41 [glibc] String: Add three more overflow tests cases to test-strnlen.c Noah Goldstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).