mirror of
https://github.com/curl/curl.git
synced 2026-08-01 16:30:32 +03:00
tool_urlglob: fix memory-leak on glob range overflow
Follow-up to 5f273fdddf
Pointed out by Codex Security
Closes #20956
This commit is contained in:
parent
91b422d356
commit
1098e1044e
1 changed files with 4 additions and 2 deletions
|
|
@ -130,8 +130,10 @@ static CURLcode glob_set(struct URLGlob *glob, const char **patternp,
|
|||
done = TRUE;
|
||||
FALLTHROUGH();
|
||||
case ',':
|
||||
if(size >= 100000)
|
||||
return globerror(glob, "range overflow", 0, CURLE_URL_MALFORMAT);
|
||||
if(size >= 100000) {
|
||||
result = globerror(glob, "range overflow", 0, CURLE_URL_MALFORMAT);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if(!palloc) {
|
||||
palloc = 5; /* a reasonable default */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue