]> granicus.if.org Git - php/commitdiff
fix crash when using default algorithm
authorRob Richards <rrichards@php.net>
Wed, 9 Jan 2008 16:46:52 +0000 (16:46 +0000)
committerRob Richards <rrichards@php.net>
Wed, 9 Jan 2008 16:46:52 +0000 (16:46 +0000)
ext/openssl/openssl.c

index fdbc348acd7d5b02bab875c9f626b99fbbbfc9c1..4816b0b76b0a5cf95c3ce1b575039408d9d2095a 100644 (file)
@@ -3725,7 +3725,7 @@ PHP_FUNCTION(openssl_sign)
        }
 
        if (method == NULL || Z_TYPE_P(method) == IS_LONG) {
-               if (Z_TYPE_P(method) == IS_LONG) {
+               if (method != NULL) {
                        signature_algo = Z_LVAL_P(method);
                }
                mdtype = php_openssl_get_evp_md_from_algo(signature_algo);
@@ -3780,7 +3780,7 @@ PHP_FUNCTION(openssl_verify)
        }
 
        if (method == NULL || Z_TYPE_P(method) == IS_LONG) {
-               if (Z_TYPE_P(method) == IS_LONG) {
+               if (method != NULL) {
                        signature_algo = Z_LVAL_P(method);
                }
                mdtype = php_openssl_get_evp_md_from_algo(signature_algo);