summaryrefslogtreecommitdiff
path: root/lib/strtoofft.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-11-17 08:41:44 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-11-17 23:15:37 +0100
commite9c580de4efcc0c1eefbb60bf3f454ee43dd4e1e (patch)
tree8d0457165bb76dd4f3b548a8fe64c75c44d8c92b /lib/strtoofft.c
parent0fef73ea4ac850304766be42383ed22fa7da6363 (diff)
downloadcurl-e9c580de4efcc0c1eefbb60bf3f454ee43dd4e1e.tar.gz
lib: parse numbers with fixed known base 10
... instead of using 0 argument that allows decimal, hex or octal when the number is documented and assumed to use base 10. Closes #9933
Diffstat (limited to 'lib/strtoofft.c')
-rw-r--r--lib/strtoofft.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/strtoofft.c b/lib/strtoofft.c
index 30deb8c05..fb8d92196 100644
--- a/lib/strtoofft.c
+++ b/lib/strtoofft.c
@@ -221,6 +221,7 @@ CURLofft curlx_strtoofft(const char *str, char **endp, int base,
curl_off_t number;
errno = 0;
*num = 0; /* clear by default */
+ DEBUGASSERT(base); /* starting now, avoid base zero */
while(*str && ISBLANK(*str))
str++;