]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
e_loader_attic: fix a use after free issue
authorPauli <pauli@openssl.org>
Wed, 12 May 2021 04:10:49 +0000 (14:10 +1000)
committerPauli <pauli@openssl.org>
Thu, 13 May 2021 08:00:36 +0000 (18:00 +1000)
Fixes #15116

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15238)

engines/e_loader_attic.c

index 802b3d9067188355533a7a63c674f2887faf2204..4cb98280a5340ef152e45c87cebbdd4e624b3342 100644 (file)
@@ -199,6 +199,7 @@ static OSSL_STORE_INFO *new_EMBEDDED(const char *new_pem_name,
         return NULL;
     }
 
+    data->blob = embedded;
     data->pem_name =
         new_pem_name == NULL ? NULL : OPENSSL_strdup(new_pem_name);
 
@@ -207,7 +208,6 @@ static OSSL_STORE_INFO *new_EMBEDDED(const char *new_pem_name,
         store_info_free(info);
         info = NULL;
     }
-    data->blob = embedded;
 
     return info;
 }