[openssl] openssl-3.0 update

beldmit at gmail.com beldmit at gmail.com
Tue Sep 21 16:43:17 UTC 2021


The branch openssl-3.0 has been updated
       via  c84f7c4c22828574885916479885ede6b32ba473 (commit)
      from  5a05c0d05233051f7af736e4f906b99f42212526 (commit)


- Log -----------------------------------------------------------------
commit c84f7c4c22828574885916479885ede6b32ba473
Author: Dmitry Belyavskiy <beldmit at gmail.com>
Date:   Mon Sep 20 16:35:10 2021 +0200

    Avoid double-free on unsuccessful getting PRNG seeding
    
    Fixes #16631
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/16636)
    
    (cherry picked from commit 52dcc011191ad1a40fd52ae92ef009309deaca52)

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

Summary of changes:
 providers/implementations/rands/seed_src.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/providers/implementations/rands/seed_src.c b/providers/implementations/rands/seed_src.c
index 173c99ce17..7a4b780bb4 100644
--- a/providers/implementations/rands/seed_src.c
+++ b/providers/implementations/rands/seed_src.c
@@ -201,10 +201,11 @@ static size_t seed_get_seed(void *vseed, unsigned char **pout,
         ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
         return 0;
     }
-    *pout = p;
     if (seed_src_generate(vseed, p, bytes_needed, 0, prediction_resistance,
-                          adin, adin_len) != 0)
+                          adin, adin_len) != 0) {
+        *pout = p;
         return bytes_needed;
+    }
     OPENSSL_secure_clear_free(p, bytes_needed);
     return 0;
 }


More information about the openssl-commits mailing list