]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.0' into PHP-7.1
authorStanislav Malyshev <stas@php.net>
Thu, 13 Oct 2016 06:26:15 +0000 (23:26 -0700)
committerAnatol Belski <ab@php.net>
Thu, 13 Oct 2016 23:58:48 +0000 (01:58 +0200)
* 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)

ext/openssl/openssl.c

index 1aa59ad43adae62cc9bf7147eb80c314d1817972..3bad71708878510c0eabbcb537f0e1abc28b03ae 100644 (file)
@@ -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);