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

index bf22e8deac8a82a190dedcdb7ad6fcff691dd195..2da9317edf9ca4247e24a15cc7bffd5ca9b4d9e5 100644 (file)
@@ -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);