From b47bbf83635bb5a156ad3298db562c49a30f0330 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 2 Aug 2025 14:48:42 +0200 Subject: [PATCH] calloc ``` valgrind ERROR ==118247== Conditional jump or move depends on uninitialised value(s) ==118247== at 0x485400A: strpbrk (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==118247== by 0x15D9BC: Curl_get_pathname (curl_path.c:180) ==118247== by 0x126263: test_unit2604 (unit2604.c:85) ==118247== by 0x124905: main (first.c:281) ==118247== ==118247== Conditional jump or move depends on uninitialised value(s) ==118247== at 0x484F238: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==118247== by 0x15DB07: Curl_get_pathname (curl_path.c:182) ==118247== by 0x126263: test_unit2604 (unit2604.c:85) ==118247== by 0x124905: main (first.c:281) ==118247== ==118247== Conditional jump or move depends on uninitialised value(s) ==118247== at 0x4854136: strspn (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==118247== by 0x15D9D7: Curl_get_pathname (curl_path.c:185) ==118247== by 0x126263: test_unit2604 (unit2604.c:85) ==118247== by 0x124905: main (first.c:281) ==118247== ``` https://github.com/curl/curl/actions/runs/16693117599/job/47253533140?pr=18143#step:39:3585 --- tests/unit/unit2604.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/unit2604.c b/tests/unit/unit2604.c index 2657c37f76..e8a9d76a33 100644 --- a/tests/unit/unit2604.c +++ b/tests/unit/unit2604.c @@ -75,7 +75,7 @@ static CURLcode test_unit2604(const char *arg) #pragma GCC diagnostic pop #endif - char *cp0 = malloc(too_long + 1); + char *cp0 = calloc(1, too_long + 1); abort_unless(cp0, "could not alloc too long value"); memset(cp0, 'a', too_long);