From a6618b52508049771c1eb988bebe2f2bcfd9ea33 Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Thu, 24 Nov 2016 22:25:14 -0500 Subject: tool_urlglob: Improve sanity check in glob_range Prior to this change we depended on errno if strtol could not perform a conversion. POSIX says EINVAL *may* be set. Some implementations like Microsoft's will not set it if there's no conversion. Ref: https://github.com/curl/curl/commit/ee4f7660#commitcomment-19658189 --- src/tool_urlglob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c index 23fc7f39e..e68e30e84 100644 --- a/src/tool_urlglob.c +++ b/src/tool_urlglob.c @@ -201,7 +201,7 @@ static CURLcode glob_range(URLGlob *glob, char **patternp, unsigned long lstep; errno = 0; lstep = strtoul(&pattern[4], &endp, 10); - if(errno || (*endp != ']')) + if(errno || &pattern[4] == endp || *endp != ']') step = -1; else { pattern = endp+1; -- cgit v1.2.3