[openssl-commits] [openssl] OpenSSL_1_0_2-stable update

Matt Caswell matt at openssl.org
Wed Jun 14 10:55:33 UTC 2017


The branch OpenSSL_1_0_2-stable has been updated
       via  7ff7f5e9b826325c851869846ffb0ce58fdba15f (commit)
      from  8dc2e33468b1ee80ccf617bba760c84be65dcefb (commit)


- Log -----------------------------------------------------------------
commit 7ff7f5e9b826325c851869846ffb0ce58fdba15f
Author: Bernd Edlinger <bernd.edlinger at hotmail.de>
Date:   Wed Jun 14 10:16:15 2017 +0200

    Remove the fallback from ERR_get_state because the
    return value is now checked at the callers.
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/3678)

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

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

diff --git a/crypto/err/err.c b/crypto/err/err.c
index 32fe8f3..03d407c 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -1022,7 +1022,6 @@ void ERR_remove_state(unsigned long pid)
 
 ERR_STATE *ERR_get_state(void)
 {
-    static ERR_STATE fallback;
     ERR_STATE *ret, tmp, *tmpp = NULL;
     int i;
     CRYPTO_THREADID tid;
@@ -1036,7 +1035,7 @@ ERR_STATE *ERR_get_state(void)
     if (ret == NULL) {
         ret = (ERR_STATE *)OPENSSL_malloc(sizeof(ERR_STATE));
         if (ret == NULL)
-            return (&fallback);
+            return NULL;
         CRYPTO_THREADID_cpy(&ret->tid, &tid);
         ret->top = 0;
         ret->bottom = 0;
@@ -1048,7 +1047,7 @@ ERR_STATE *ERR_get_state(void)
         /* To check if insertion failed, do a get. */
         if (ERRFN(thread_get_item) (ret) != ret) {
             ERR_STATE_free(ret); /* could not insert it */
-            return (&fallback);
+            return NULL;
         }
         /*
          * If a race occured in this function and we came second, tmpp is the


More information about the openssl-commits mailing list