summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott MacVicar <scottmac@php.net>2012-02-23 01:26:46 +0000
committerScott MacVicar <scottmac@php.net>2012-02-23 01:26:46 +0000
commit5ef66f2cf5f9a9de07197817e495144ab22ef5ec (patch)
tree3e7a07689e25b416ba737de9b14bafaa08d62683
parentc51f737994c151ce40f43ebf9ba7e93386cf87c1 (diff)
downloadphp-git-5ef66f2cf5f9a9de07197817e495144ab22ef5ec.tar.gz
Fixed bug #61124 (Crash when decoding an invalid base64 encoded string).
-rw-r--r--NEWS3
-rw-r--r--ext/openssl/openssl.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 2c53ebaaa6..d205b8b291 100644
--- a/NEWS
+++ b/NEWS
@@ -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;
}