diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2016-11-24 22:25:14 -0500 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2016-11-24 22:25:46 -0500 |
commit | a6618b52508049771c1eb988bebe2f2bcfd9ea33 (patch) | |
tree | 55dcc17f463875404ccbd116460121d0329f005b /src | |
parent | 4bda3e04b28698cf402d8b1223b6c036c0eb1184 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/tool_urlglob.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |