]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
strtoofft: Remove extraneous null check
authorBenbuck Nason <bnason@netflix.com>
Thu, 5 Oct 2017 19:45:51 +0000 (12:45 -0700)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 6 Oct 2017 12:49:28 +0000 (14:49 +0200)
Fixes #1950: curlx_strtoofft() doesn't fully protect against null 'str'
argument.

Closes #1952

lib/strtoofft.c

index 807fc54549903a3c5dae973834009d457c20858b..363647737f1b2fb8696842d7e1350d3ad9fb07b2 100644 (file)
@@ -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)