From 454dae0092d6f367fe486bdfd49f781329bf4500 Mon Sep 17 00:00:00 2001 From: Benbuck Nason Date: Thu, 5 Oct 2017 12:45:51 -0700 Subject: strtoofft: Remove extraneous null check Fixes #1950: curlx_strtoofft() doesn't fully protect against null 'str' argument. Closes #1952 --- lib/strtoofft.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- cgit v1.2.1