* [PATCH] String: Improve overflow test coverage for strnlen
@ 2022-05-25 21:02 Sunil K Pandey
2022-05-25 21:05 ` H.J. Lu
0 siblings, 1 reply; 2+ messages in thread
From: Sunil K Pandey @ 2022-05-25 21:02 UTC (permalink / raw)
To: libc-alpha
This patch adds more overflow test coverage for strnlen and wcsnlen.
---
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);
--
2.35.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] String: Improve overflow test coverage for strnlen
2022-05-25 21:02 [PATCH] String: Improve overflow test coverage for strnlen Sunil K Pandey
@ 2022-05-25 21:05 ` H.J. Lu
0 siblings, 0 replies; 2+ messages in thread
From: H.J. Lu @ 2022-05-25 21:05 UTC (permalink / raw)
To: Sunil K Pandey; +Cc: GNU C Library
On Wed, May 25, 2022 at 2:02 PM Sunil K Pandey <skpgkp2@gmail.com> wrote:
>
> This patch adds more overflow test coverage for strnlen and wcsnlen.
> ---
> 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);
> --
> 2.35.3
>
LGTM.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
Thanks.
--
H.J.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-25 21:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25 21:02 [PATCH] String: Improve overflow test coverage for strnlen Sunil K Pandey
2022-05-25 21:05 ` H.J. Lu
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).