From: Ilia Alshanetsky Date: Thu, 2 Jan 2003 21:18:59 +0000 (+0000) Subject: Fixed a small memory leak when a NULL variable is passed to X-Git-Tag: PHP_5_0_dev_before_13561_fix~522 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f65e8488d73a573c6df8e8147f1b8edc8ad340c0;p=php Fixed a small memory leak when a NULL variable is passed to openssl_csr_sign() as the first argument. --- diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 3c0a4bb59a..377191a2c9 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1310,8 +1310,9 @@ static X509_REQ * php_openssl_csr_from_zval(zval ** val, int makeresource, long return (X509_REQ*)what; } return NULL; + } else if (Z_TYPE_PP(val) != IS_STRING) { + return NULL; } - convert_to_string_ex(val); if (Z_STRLEN_PP(val) > 7 && memcmp(Z_STRVAL_PP(val), "file://", 7) == 0) filename = Z_STRVAL_PP(val) + 7;