aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBenbuck Nason <bnason@netflix.com>2017-10-05 12:45:51 -0700
committerDaniel Stenberg <daniel@haxx.se>2017-10-06 14:49:28 +0200
commit454dae0092d6f367fe486bdfd49f781329bf4500 (patch)
tree1a22e47949a03f28490048e2d6cb3f2724d0bddb /lib
parent2dcc378381881a374289d3a1fefb3495d687bf50 (diff)
strtoofft: Remove extraneous null check
Fixes #1950: curlx_strtoofft() doesn't fully protect against null 'str' argument. Closes #1952
Diffstat (limited to 'lib')
-rw-r--r--lib/strtoofft.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/strtoofft.c b/lib/strtoofft.c
index 807fc5454..363647737 100644
--- a/lib/strtoofft.c
+++ b/lib/strtoofft.c
@@ -219,7 +219,10 @@ CURLofft curlx_strtoofft(const char *str, char **endp, int base,
curl_off_t number;
errno = 0;
*num = 0; /* clear by default */
- while(str && *str && ISSPACE(*str))
+
+ DEBUGASSERT(str);
+
+ while(*str && ISSPACE(*str))
str++;
if('-' == *str) {
if(endp)