mirror of
https://github.com/curl/curl.git
synced 2026-08-26 20:03:32 +03:00
tool_urlglob: fix off-by-one error in glob_parse()
... causing SIGSEGV while parsing URL with too many globs.
Minimal example:
$ curl $(for i in $(seq 101); do printf '{a}'; done)
Reported-by: Romain Coltel
Bug: https://bugzilla.redhat.com/1340757
This commit is contained in:
parent
873b4346ba
commit
584d0121c3
2 changed files with 3 additions and 1 deletions
|
|
@ -401,7 +401,7 @@ static CURLcode glob_parse(URLGlob *glob, char *pattern,
|
|||
}
|
||||
}
|
||||
|
||||
if(++glob->size > GLOB_PATTERN_NUM)
|
||||
if(++glob->size >= GLOB_PATTERN_NUM)
|
||||
return GLOBERROR("too many globs", pos, CURLE_URL_MALFORMAT);
|
||||
}
|
||||
return res;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue