summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/openssl/openssl.c6
1 files changed, 4 insertions, 2 deletions
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);