[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Rich Salz rsalz at openssl.org
Wed Jun 14 01:58:21 UTC 2017


The branch OpenSSL_1_1_0-stable has been updated
       via  819d18f6116e97845ebe453128f3c2a78e42a785 (commit)
      from  7cc9b2cde103745e036d256209b7cb3f696fe7af (commit)


- Log -----------------------------------------------------------------
commit 819d18f6116e97845ebe453128f3c2a78e42a785
Author: Bernd Edlinger <bernd.edlinger at hotmail.de>
Date:   Tue Jun 13 19:00:35 2017 +0200

    Fix a possible crash in the error handling.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/3672)
    
    (cherry picked from commit 4fc426b78964b3d234cb7b1b6112c9b80e16a13a)

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

Summary of changes:
 crypto/err/err.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/crypto/err/err.c b/crypto/err/err.c
index c55f849..8b47085 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -361,6 +361,8 @@ void ERR_put_error(int lib, int func, int reason, const char *file, int line)
     }
 #endif
     es = ERR_get_state();
+    if (es == NULL)
+        return;
 
     es->top = (es->top + 1) % ERR_NUM_ERRORS;
     if (es->top == es->bottom)
@@ -378,6 +380,8 @@ void ERR_clear_error(void)
     ERR_STATE *es;
 
     es = ERR_get_state();
+    if (es == NULL)
+        return;
 
     for (i = 0; i < ERR_NUM_ERRORS; i++) {
         err_clear(es, i);
@@ -442,6 +446,8 @@ static unsigned long get_error_values(int inc, int top, const char **file,
     unsigned long ret;
 
     es = ERR_get_state();
+    if (es == NULL)
+        return 0;
 
     if (inc && top) {
         if (file)
@@ -692,6 +698,8 @@ void ERR_set_error_data(char *data, int flags)
     int i;
 
     es = ERR_get_state();
+    if (es == NULL)
+        return;
 
     i = es->top;
     if (i == 0)
@@ -747,6 +755,8 @@ int ERR_set_mark(void)
     ERR_STATE *es;
 
     es = ERR_get_state();
+    if (es == NULL)
+        return 0;
 
     if (es->bottom == es->top)
         return 0;
@@ -759,6 +769,8 @@ int ERR_pop_to_mark(void)
     ERR_STATE *es;
 
     es = ERR_get_state();
+    if (es == NULL)
+        return 0;
 
     while (es->bottom != es->top
            && (es->err_flags[es->top] & ERR_FLAG_MARK) == 0) {


More information about the openssl-commits mailing list