summaryrefslogtreecommitdiff
path: root/ext/openssl/openssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/openssl.c')
-rw-r--r--ext/openssl/openssl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index f117df6ba8..7c5afc55d7 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4776,6 +4776,10 @@ PHP_FUNCTION(openssl_decrypt)
if (!raw_input) {
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;
}