summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2004-10-26 09:29:22 +0000
committerWez Furlong <wez@php.net>2004-10-26 09:29:22 +0000
commit8cb520a8558c0ef851feb7ea339d838a2a30bf14 (patch)
tree46bc98ee7c51be7a9c1651ad42bc3ed250fb3f9f
parent06a0021a557e06f0c65edc53810dc763302f4cf2 (diff)
downloadphp-git-8cb520a8558c0ef851feb7ea339d838a2a30bf14.tar.gz
Fix for Bug #29418 (double free when openssl_csr_new fails).
Also hook up MSHUTDOWN function which appears to have never been enabled. Patch by Kamesh Jayachandran
-rw-r--r--ext/openssl/openssl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index d2f5999b0f..b1a7c856a8 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -118,7 +118,7 @@ zend_module_entry openssl_module_entry = {
"openssl",
openssl_functions,
PHP_MINIT(openssl),
- NULL,
+ PHP_MSHUTDOWN(openssl),
NULL,
NULL,
PHP_MINFO(openssl),
@@ -1616,6 +1616,12 @@ PHP_FUNCTION(openssl_csr_new)
req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */
}
}
+ else {
+ if (!we_made_the_key) {
+ /* if we have not made the key we are not supposed to zap it by calling dispose! */
+ req.priv_key = NULL;
+ }
+ }
}
}
}