]> granicus.if.org Git - php/commitdiff
Fix bug #72541 - size_t overflow lead to heap corruption
authorStanislav Malyshev <stas@php.net>
Wed, 13 Jul 2016 05:59:19 +0000 (22:59 -0700)
committerStanislav Malyshev <stas@php.net>
Wed, 13 Jul 2016 05:59:19 +0000 (22:59 -0700)
ext/curl/interface.c

index 6a616411ef6c382e9a89dc651cd697771140362a..7d085de73cccebe987dd0416248d4acda143986e 100644 (file)
@@ -3595,6 +3595,10 @@ PHP_FUNCTION(curl_unescape)
                RETURN_FALSE;
        }
 
+       if (str_len > INT_MAX) {
+               RETURN_FALSE;
+       }
+
        if ((out = curl_easy_unescape(ch->cp, str, str_len, &out_len))) {
                RETVAL_STRINGL(out, out_len);
                curl_free(out);