From 37d5de02df86ac8a7c27bdece5e70fcc02b6ff5d Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 3 Jun 2025 22:39:00 +0200 Subject: [PATCH] Remove dead code from openssl_spki_new() implementation If s is not NULL, the length can't be <= 0 because we at least append `spkac` in the string, which is non-empty. I noticed this condition because if it were actually possible to execute, then it would leak memory. --- ext/openssl/openssl.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index aab240dc8506a..72f05a4bb2578 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -651,10 +651,6 @@ PHP_FUNCTION(openssl_spki_new) if (spki != NULL) { NETSCAPE_SPKI_free(spki); } - - if (s && ZSTR_LEN(s) <= 0) { - RETVAL_FALSE; - } } /* }}} */