From: Stanislav Malyshev Date: Thu, 13 Oct 2016 06:26:15 +0000 (-0700) Subject: Merge branch 'PHP-7.0' into PHP-7.1 X-Git-Tag: php-7.1.0RC4~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=177e6adca7349bf97c3c543fd0aea577583129cb;p=php Merge branch 'PHP-7.0' into PHP-7.1 * PHP-7.0: Fix outlen for openssl function Syncronize with 5.6 - __toString should return "" Fix potential overflows in php_pcre_replace_impl (cherry picked from commit ff75665663045a96d6f182e24283e6bebb8537fa) --- diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 1aa59ad43a..3bad717088 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -6342,7 +6342,7 @@ PHP_FUNCTION(openssl_decrypt) const EVP_CIPHER *cipher_type; EVP_CIPHER_CTX *cipher_ctx; struct php_openssl_cipher_mode mode; - int outlen, i = 0; + int i = 0, outlen; zend_string *outbuf; zend_string *base64_str = NULL; zend_bool free_iv = 0, free_password = 0; @@ -6377,7 +6377,7 @@ PHP_FUNCTION(openssl_decrypt) php_openssl_load_cipher_mode(&mode, cipher_type); if (!(options & OPENSSL_RAW_DATA)) { - base64_str = php_base64_decode_ex((unsigned char*)data, (int)data_len, 1); + base64_str = php_base64_decode((unsigned char*)data, data_len); if (!base64_str) { php_error_docref(NULL, E_WARNING, "Failed to base64 decode the input"); EVP_CIPHER_CTX_free(cipher_ctx);