summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}