From 8e1990dff6940cafd91f3bc6204fac8cabec344d Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Fri, 31 Jul 2026 14:15:10 +0200 Subject: [PATCH] Lib: Fix endptr in bstrtoul16() The endptr in bstrtoul16() should be always defined on return to avoid bad usage by callers. Otherwise, dereferencing undefined ptr may lead to crash on parsing long numbers. Reported-By: Benedikt Neuffer --- lib/strtoul.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/strtoul.c b/lib/strtoul.c index 420931a40..15d2c78bc 100644 --- a/lib/strtoul.c +++ b/lib/strtoul.c @@ -56,6 +56,7 @@ bstrtoul16(const char *str, char **end) } } + *end = (char *) &(str[16]); /* Overflow position */ errno = ERANGE; return UINT64_MAX; } -- 2.47.3