diff options
Diffstat (limited to 'lib/escape.c')
-rw-r--r-- | lib/escape.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/escape.c b/lib/escape.c index e61260d7c..66570076e 100644 --- a/lib/escape.c +++ b/lib/escape.c @@ -224,8 +224,14 @@ char *curl_easy_unescape(struct Curl_easy *data, const char *string, FALSE); if(res) return NULL; - if(olen) - *olen = curlx_uztosi(outputlen); + + if(olen) { + if(outputlen <= (size_t) INT_MAX) + *olen = curlx_uztosi(outputlen); + else + /* too large to return in an int, fail! */ + Curl_safefree(str); + } } return str; } |