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

index 312f9739d47b87dac08c91265625eca6f29f92b0..cda630703b48bfb3ed81c7a5b5ed0747cc89a3dc 100644 (file)
@@ -3687,7 +3687,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);
@@ -3742,7 +3742,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);