mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix for bug #72807 - do not produce strings with negative length
This commit is contained in:
parent
5a34bd6d1e
commit
1cd6bc6463
2 changed files with 9 additions and 2 deletions
|
@ -3478,6 +3478,10 @@ PHP_FUNCTION(curl_escape)
|
|||
ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl);
|
||||
|
||||
if ((res = curl_easy_escape(ch->cp, str, str_len))) {
|
||||
if (strlen(res) > INT_MAX) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Escaped string is too long, maximum is %d", INT_MAX);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETVAL_STRING(res, 1);
|
||||
curl_free(res);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue