From dc7e42c6a12637bae1660561d3f4cef039001475 Mon Sep 17 00:00:00 2001 From: x2018 Date: Tue, 23 Nov 2021 19:25:43 +0800 Subject: [PATCH] check the return value of OPENSSL_strdup to prevent potential memory access error Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/17110) --- apps/lib/engine_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/lib/engine_loader.c b/apps/lib/engine_loader.c index 7ea05943f38..aa1bad26a4b 100644 --- a/apps/lib/engine_loader.c +++ b/apps/lib/engine_loader.c @@ -89,7 +89,7 @@ static OSSL_STORE_LOADER_CTX *engine_open(const OSSL_STORE_LOADER *loader, keyid = OPENSSL_strdup(q + 1); } - if (e != NULL) + if (e != NULL && keyid != NULL) ctx = OSSL_STORE_LOADER_CTX_new(e, keyid); if (ctx == NULL) { -- 2.47.2