From 0a70b02bbb44ecb774562cb8b4559b2ec823c2d1 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 27 Sep 2021 11:49:05 +0300 Subject: [PATCH] lib: test-strfuncs - Avoid testing p_strndup() with overlong max_chars parameter This ended up in memchr() call with n=SIZE_MAX-1, which sometimes doesn't work right with old glibc versions. Fixes: Panic: Trying to allocate 18446744073709551615 bytes --- src/lib/test-strfuncs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/test-strfuncs.c b/src/lib/test-strfuncs.c index f9154709f9..b5463846bd 100644 --- a/src/lib/test-strfuncs.c +++ b/src/lib/test-strfuncs.c @@ -26,7 +26,7 @@ static void test_p_strndup(void) { "foo", "fo", 2 }, { "foo", "foo", 3 }, { "foo", "foo", 4 }, - { "foo", "foo", SIZE_MAX-1 }, + { "foo\0more", "foo", 8 }, }; test_begin("p_strndup()"); -- 2.47.3