mirror of
https://github.com/curl/curl.git
synced 2026-05-24 02:06:21 +03:00
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: ee4f7660 (commitcomment-19658189)
This commit is contained in:
parent
4bda3e04b2
commit
a6618b5250
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue