[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Fri Mar 11 13:39:46 UTC 2016


The branch master has been updated
       via  773fd0bad487fe8f1cf722ca14cec2c4a2da3e21 (commit)
      from  71627423e57882a038e65993c948b2ec78c837a1 (commit)


- Log -----------------------------------------------------------------
commit 773fd0bad487fe8f1cf722ca14cec2c4a2da3e21
Author: Matt Caswell <matt at openssl.org>
Date:   Fri Mar 11 09:52:52 2016 +0000

    Call CONF_modules_free() before ENGINE_cleanup() in auto-deinit
    
    During auto de-init we were calling ENGINE_cleanup(), and then later
    CONF_modules_free(). However the latter function can end up calling
    engine code, which can lead to a use of the global_engine_lock after it
    has already been freed. Therefore we should swap the calling order of
    these two functions.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 crypto/init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/crypto/init.c b/crypto/init.c
index 1cac741..aac87de 100644
--- a/crypto/init.c
+++ b/crypto/init.c
@@ -469,12 +469,12 @@ void OPENSSL_cleanup(void)
                     "RAND_cleanup()\n");
 
 #endif
-#ifndef OPENSSL_NO_ENGINE
-    ENGINE_cleanup();
-#endif
     CRYPTO_cleanup_all_ex_data();
     EVP_cleanup();
     CONF_modules_free();
+#ifndef OPENSSL_NO_ENGINE
+    ENGINE_cleanup();
+#endif
     RAND_cleanup();
     base_inited = 0;
 }


More information about the openssl-commits mailing list