mirror of
https://github.com/curl/curl.git
synced 2026-07-24 17:17:22 +03:00
urlglob: only accept 255 globs
- using {} with single entries makes little sense
- when using {} sets with two entry lists, there can only be 64 to reach
maximum number of URLs
Verify the max check in test 761
This commit is contained in:
parent
598078dcf8
commit
4a3ed6fc16
3 changed files with 40 additions and 4 deletions
|
|
@ -423,10 +423,13 @@ static CURLcode glob_parse(struct URLGlob *glob, const char *pattern,
|
|||
if(++glob->size >= glob->palloc) {
|
||||
struct URLPattern *np = NULL;
|
||||
glob->palloc *= 2;
|
||||
if(glob->size < 10000) /* avoid ridiculous amounts */
|
||||
if(glob->size < 255) { /* avoid ridiculous amounts */
|
||||
np = realloc(glob->pattern, glob->palloc * sizeof(struct URLPattern));
|
||||
if(!np)
|
||||
return globerror(glob, NULL, pos, CURLE_OUT_OF_MEMORY);
|
||||
if(!np)
|
||||
return globerror(glob, NULL, pos, CURLE_OUT_OF_MEMORY);
|
||||
}
|
||||
else
|
||||
return globerror(glob, "too many {} sets", pos, CURLE_URL_MALFORMAT);
|
||||
glob->pattern = np;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue