public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Noah Goldstein <goldstein.w.n@gmail.com>
To: libc-alpha@sourceware.org
Subject: [PATCH v1 1/2] String: Add three more overflow tests cases to test-strnlen.c
Date: Wed, 23 Jun 2021 19:59:02 -0400	[thread overview]
Message-ID: <20210623235902.1614933-1-goldstein.w.n@gmail.com> (raw)

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>
---
 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);
         }
     }
 }
-- 
2.25.1


             reply	other threads:[~2021-06-23 23:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-23 23:59 Noah Goldstein [this message]
2021-06-23 23:59 ` [PATCH v1 2/2] x86: Remove unnecessary overflow check from wcsnlen-sse4_1.S Noah Goldstein
2021-06-24  0:41   ` H.J. Lu
2022-04-28  0:08     ` Sunil Pandey
2021-06-24  0:41 ` [PATCH v1 1/2] String: Add three more overflow tests cases to test-strnlen.c H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210623235902.1614933-1-goldstein.w.n@gmail.com \
    --to=goldstein.w.n@gmail.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).