diff options
author | Scott MacVicar <scottmac@php.net> | 2012-02-23 01:26:46 +0000 |
---|---|---|
committer | Scott MacVicar <scottmac@php.net> | 2012-02-23 01:26:46 +0000 |
commit | 5ef66f2cf5f9a9de07197817e495144ab22ef5ec (patch) | |
tree | 3e7a07689e25b416ba737de9b14bafaa08d62683 | |
parent | c51f737994c151ce40f43ebf9ba7e93386cf87c1 (diff) | |
download | php-git-5ef66f2cf5f9a9de07197817e495144ab22ef5ec.tar.gz |
Fixed bug #61124 (Crash when decoding an invalid base64 encoded string).
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | ext/openssl/openssl.c | 4 |
2 files changed, 7 insertions, 0 deletions
@@ -1,6 +1,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2012, PHP 5.4.0 RC 9 +- OpenSSL: + . Fixed bug #61124 (Crash when decoding an invalid base64 encoded string). + (me at ktamura dot com, Scott) 15 Feb 2012, PHP 5.4.0 RC 8 - Core: diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index ea1c2d7f79..7187a9601e 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -4803,6 +4803,10 @@ PHP_FUNCTION(openssl_decrypt) if (!(options & OPENSSL_RAW_DATA)) { base64_str = (char*)php_base64_decode((unsigned char*)data, data_len, &base64_str_len); + if (!base64_str) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to base64 decode the input"); + RETURN_FALSE; + } data_len = base64_str_len; data = base64_str; } |