com php-src: Fix bug #72674 - check both curl_escape and curl_unescape: ext/curl/interface.c
| From: | Anatol Belski | Date: | Wed, 17 Aug 2016 09:30:38 +0000 |
| Subject: | com php-src: Fix bug #72674 - check both curl_escape and curl_unescape: ext/curl/interface.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-93903@lists.php.net to get a copy of this message | ||
Commit: 19c10bb629139c42f55f10c9c84dfe3ba29567c6
Author: Stanislav Malyshev <stas@php.net> Wed, 3 Aug 2016 00:58:55 -0700
Committer: Anatol Belski <ab@php.net> Wed, 17 Aug 2016 11:30:38 +0200
Parents: 0a85fd9877feb44520d2967f64ebb20483264e52
Branches: PHP-7.0.10
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=19c10bb629139c42f55f10c9c84dfe3ba29567c6
Log:
Fix bug #72674 - check both curl_escape and curl_unescape
(cherry picked from commit 72dbb7f416160f490c4e9987040989a10ad431c7)
Bugs:
https://bugs.php.net/72674
Changed paths:
M ext/curl/interface.c
Diff:
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index be15785..7069710 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -3517,7 +3517,7 @@ PHP_FUNCTION(curl_reset)
PHP_FUNCTION(curl_escape)
{
char *str = NULL, *res = NULL;
- size_t str_len = 0;
+ size_t str_len = 0;
zval *zid;
php_curl *ch;
@@ -3529,6 +3529,10 @@ PHP_FUNCTION(curl_escape)
RETURN_FALSE;
}
+ if (ZEND_SIZE_T_INT_OVFL(str_len)) {
+ RETURN_FALSE;
+ }
+
if ((res = curl_easy_escape(ch->cp, str, str_len))) {
RETVAL_STRING(res);
curl_free(res);
@@ -3556,7 +3560,7 @@ PHP_FUNCTION(curl_unescape)
RETURN_FALSE;
}
- if (str_len > INT_MAX) {
+ if (ZEND_SIZE_T_INT_OVFL(str_len)) {
RETURN_FALSE;
}