Skip to content

Commit 7f26171

Browse files
committed
Remove confusing spkstr checks
This is a required parameter, it can never be NULL.
1 parent 8a8bc5c commit 7f26171

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

ext/openssl/openssl.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ PHP_FUNCTION(openssl_spki_verify)
19331933
{
19341934
size_t spkstr_len;
19351935
int i = 0, spkstr_cleaned_len = 0;
1936-
char *spkstr = NULL, * spkstr_cleaned = NULL;
1936+
char *spkstr, * spkstr_cleaned = NULL;
19371937

19381938
EVP_PKEY *pkey = NULL;
19391939
NETSCAPE_SPKI *spki = NULL;
@@ -1943,11 +1943,6 @@ PHP_FUNCTION(openssl_spki_verify)
19431943
}
19441944
RETVAL_FALSE;
19451945

1946-
if (spkstr == NULL) {
1947-
php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC");
1948-
goto cleanup;
1949-
}
1950-
19511946
spkstr_cleaned = emalloc(spkstr_len + 1);
19521947
spkstr_cleaned_len = (int)(spkstr_len - php_openssl_spki_cleanup(spkstr, spkstr_cleaned));
19531948

@@ -1997,7 +1992,7 @@ PHP_FUNCTION(openssl_spki_verify)
19971992
PHP_FUNCTION(openssl_spki_export)
19981993
{
19991994
size_t spkstr_len;
2000-
char *spkstr = NULL, * spkstr_cleaned = NULL, * s = NULL;
1995+
char *spkstr, * spkstr_cleaned = NULL, * s = NULL;
20011996
int spkstr_cleaned_len;
20021997

20031998
EVP_PKEY *pkey = NULL;
@@ -2009,11 +2004,6 @@ PHP_FUNCTION(openssl_spki_export)
20092004
}
20102005
RETVAL_FALSE;
20112006

2012-
if (spkstr == NULL) {
2013-
php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC");
2014-
goto cleanup;
2015-
}
2016-
20172007
spkstr_cleaned = emalloc(spkstr_len + 1);
20182008
spkstr_cleaned_len = (int)(spkstr_len - php_openssl_spki_cleanup(spkstr, spkstr_cleaned));
20192009

@@ -2072,7 +2062,7 @@ PHP_FUNCTION(openssl_spki_export)
20722062
PHP_FUNCTION(openssl_spki_export_challenge)
20732063
{
20742064
size_t spkstr_len;
2075-
char *spkstr = NULL, * spkstr_cleaned = NULL;
2065+
char *spkstr, * spkstr_cleaned = NULL;
20762066
int spkstr_cleaned_len;
20772067

20782068
NETSCAPE_SPKI *spki = NULL;
@@ -2082,11 +2072,6 @@ PHP_FUNCTION(openssl_spki_export_challenge)
20822072
}
20832073
RETVAL_FALSE;
20842074

2085-
if (spkstr == NULL) {
2086-
php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC");
2087-
goto cleanup;
2088-
}
2089-
20902075
spkstr_cleaned = emalloc(spkstr_len + 1);
20912076
spkstr_cleaned_len = (int)(spkstr_len - php_openssl_spki_cleanup(spkstr, spkstr_cleaned));
20922077

0 commit comments

Comments
 (0)