]> granicus.if.org Git - php/commitdiff
- make the test more obvious and add an explanation
authorPierre Joye <pajoye@php.net>
Sat, 29 Jul 2006 23:03:38 +0000 (23:03 +0000)
committerPierre Joye <pajoye@php.net>
Sat, 29 Jul 2006 23:03:38 +0000 (23:03 +0000)
ext/openssl/openssl.c

index b67aa7c8e44228094ee628dd79110e2e49a63188..7b099b6782f1d591228623182ccc13e50cc4c6ac 100644 (file)
@@ -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);