From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7852) id DEA263856DCA; Wed, 25 May 2022 23:06:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DEA263856DCA Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Sunil Pandey To: glibc-cvs@sourceware.org Subject: [glibc] String: Improve overflow test coverage for strnlen X-Act-Checkin: glibc X-Git-Author: Sunil K Pandey X-Git-Refname: refs/heads/master X-Git-Oldrev: 3d9926663cba19f40d26d8a8ab3b2a7cc09ffb13 X-Git-Newrev: 7597b251d451fa099686344bbd9915bd481ba55b Message-Id: <20220525230606.DEA263856DCA@sourceware.org> Date: Wed, 25 May 2022 23:06:06 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2022 23:06:07 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7597b251d451fa099686344bbd9915bd481ba55b commit 7597b251d451fa099686344bbd9915bd481ba55b Author: Sunil K Pandey Date: Wed May 25 13:43:36 2022 -0700 String: Improve overflow test coverage for strnlen This patch adds more overflow test coverage for strnlen and wcsnlen. Reviewed-by: H.J. Lu Diff: --- string/test-strnlen.c | 2 ++ 1 file changed, 2 insertions(+) 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);