From: Pierre Joye Date: Sat, 29 Jul 2006 23:03:56 +0000 (+0000) Subject: - MFH: make the test more obvious and add an explanation X-Git-Tag: php-5.2.0RC2~155 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a75600dbba942caab0339da55084fd1e7de9884;p=php - MFH: make the test more obvious and add an explanation --- diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index bf22e8deac..2da9317edf 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1847,8 +1847,10 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char * return NULL; } else { /* force it to be a string and check if it refers to a file */ - if (Z_TYPE_PP(val) == IS_LONG || Z_TYPE_PP(val) == IS_BOOL - || Z_TYPE_PP(val) == IS_ARRAY) { + /* passing non string values leaks, object uses toString, it returns NULL + * See bug38255.phpt + */ + if (!(Z_TYPE_PP(val) == IS_STRING || Z_TYPE_PP(val) == IS_OBJECT)) { return NULL; } convert_to_string_ex(val);