mirror of
https://github.com/curl/curl.git
synced 2026-06-17 01:25:42 +03:00
escape: add a length in curl_easy_escape
Only accept up to SIZE_MAX/16 input bytes. To avoid overflows, mistakes and abuse. Reported-by: Daniel Santos
This commit is contained in:
parent
436e67f65b
commit
e405caf53d
1 changed files with 3 additions and 0 deletions
|
|
@ -62,6 +62,9 @@ char *curl_easy_escape(CURL *data, const char *string, int inlength)
|
|||
if(!length)
|
||||
return curlx_strdup("");
|
||||
|
||||
if(length > SIZE_MAX/16)
|
||||
return NULL;
|
||||
|
||||
curlx_dyn_init(&d, length * 3 + 1);
|
||||
|
||||
while(length--) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue