summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2006-07-29 23:03:56 +0000
committerPierre Joye <pajoye@php.net>2006-07-29 23:03:56 +0000
commit3a75600dbba942caab0339da55084fd1e7de9884 (patch)
tree6125b0d3b96049c9334b5c5cd3107cfde7a59701 /ext
parent3fe91ed83f2bd5e95aa94014f952cc4c86d0b04e (diff)
downloadphp-git-3a75600dbba942caab0339da55084fd1e7de9884.tar.gz
- MFH: make the test more obvious and add an explanation
Diffstat (limited to 'ext')
-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);