From: Benbuck Nason Date: Thu, 5 Oct 2017 19:45:51 +0000 (-0700) Subject: strtoofft: Remove extraneous null check X-Git-Tag: curl-7_56_1~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=454dae0092d6f367fe486bdfd49f781329bf4500;p=thirdparty%2Fcurl.git strtoofft: Remove extraneous null check Fixes #1950: curlx_strtoofft() doesn't fully protect against null 'str' argument. Closes #1952 --- diff --git a/lib/strtoofft.c b/lib/strtoofft.c index 807fc54549..363647737f 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)