From: Pierre Joye Date: Sat, 29 Jul 2006 23:03:38 +0000 (+0000) Subject: - make the test more obvious and add an explanation X-Git-Tag: RELEASE_1_0_0RC1~2173 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5016f0d0e9820fd9169993bd330a82fa946da1f9;p=php - make the test more obvious and add an explanation --- diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index b67aa7c8e4..7b099b6782 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1824,8 +1824,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 + * bug38255.phpt + */ + if (!(Z_TYPE_PP(val) == IS_STRING || Z_TYPE_PP(val) == IS_OBJECT)) { return NULL; } convert_to_string_ex(val);