From: Nikita Popov Date: Fri, 31 May 2019 14:59:46 +0000 (+0200) Subject: Remove confusing spkstr checks X-Git-Tag: php-7.4.0alpha1~128 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f26171445e0b060196bb9b6f1fc506269ced8a4;p=php Remove confusing spkstr checks This is a required parameter, it can never be NULL. --- diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 23ce1c9242..30d984c300 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1933,7 +1933,7 @@ PHP_FUNCTION(openssl_spki_verify) { size_t spkstr_len; int i = 0, spkstr_cleaned_len = 0; - char *spkstr = NULL, * spkstr_cleaned = NULL; + char *spkstr, * spkstr_cleaned = NULL; EVP_PKEY *pkey = NULL; NETSCAPE_SPKI *spki = NULL; @@ -1943,11 +1943,6 @@ PHP_FUNCTION(openssl_spki_verify) } RETVAL_FALSE; - if (spkstr == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC"); - goto cleanup; - } - spkstr_cleaned = emalloc(spkstr_len + 1); spkstr_cleaned_len = (int)(spkstr_len - php_openssl_spki_cleanup(spkstr, spkstr_cleaned)); @@ -1997,7 +1992,7 @@ cleanup: PHP_FUNCTION(openssl_spki_export) { size_t spkstr_len; - char *spkstr = NULL, * spkstr_cleaned = NULL, * s = NULL; + char *spkstr, * spkstr_cleaned = NULL, * s = NULL; int spkstr_cleaned_len; EVP_PKEY *pkey = NULL; @@ -2009,11 +2004,6 @@ PHP_FUNCTION(openssl_spki_export) } RETVAL_FALSE; - if (spkstr == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC"); - goto cleanup; - } - spkstr_cleaned = emalloc(spkstr_len + 1); spkstr_cleaned_len = (int)(spkstr_len - php_openssl_spki_cleanup(spkstr, spkstr_cleaned)); @@ -2072,7 +2062,7 @@ cleanup: PHP_FUNCTION(openssl_spki_export_challenge) { size_t spkstr_len; - char *spkstr = NULL, * spkstr_cleaned = NULL; + char *spkstr, * spkstr_cleaned = NULL; int spkstr_cleaned_len; NETSCAPE_SPKI *spki = NULL; @@ -2082,11 +2072,6 @@ PHP_FUNCTION(openssl_spki_export_challenge) } RETVAL_FALSE; - if (spkstr == NULL) { - php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC"); - goto cleanup; - } - spkstr_cleaned = emalloc(spkstr_len + 1); spkstr_cleaned_len = (int)(spkstr_len - php_openssl_spki_cleanup(spkstr, spkstr_cleaned));