From f65e8488d73a573c6df8e8147f1b8edc8ad340c0 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Thu, 2 Jan 2003 21:18:59 +0000 Subject: [PATCH] Fixed a small memory leak when a NULL variable is passed to openssl_csr_sign() as the first argument. --- ext/openssl/openssl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.50.1