diff options
author | Wez Furlong <wez@php.net> | 2004-10-26 09:24:07 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2004-10-26 09:24:07 +0000 |
commit | 0a4127a61099193af989a41f14e5d4d6d5a36566 (patch) | |
tree | 270f3aeb897202b1e2023986a761f836393377df /ext/openssl/openssl.c | |
parent | 506c2e2e5b45174237085fbd2d56affff621f1e5 (diff) | |
download | php-git-0a4127a61099193af989a41f14e5d4d6d5a36566.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
Diffstat (limited to 'ext/openssl/openssl.c')
-rw-r--r-- | ext/openssl/openssl.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 3d8665b623..091b14ff77 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -135,7 +135,7 @@ zend_module_entry openssl_module_entry = { "openssl", openssl_functions, PHP_MINIT(openssl), - NULL, + PHP_MSHUTDOWN(openssl), NULL, NULL, PHP_MINFO(openssl), @@ -1675,6 +1675,12 @@ PHP_FUNCTION(openssl_csr_new) } } } + 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; + } + } } } } |