Fixed bug #61124 (Crash when decoding an invalid base64 encoded string).

This commit is contained in:
Scott MacVicar 2012-02-23 01:26:46 +00:00
parent cde7662226
commit 6c331093b4

View File

@ -4799,6 +4799,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;
}