summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorx2018 <xkernel.wang@foxmail.com>2021-11-23 19:25:43 +0800
committerPauli <ppzgs1@gmail.com>2021-11-25 10:35:37 +1000
commitea4d670a094a2b5daa13ad13db247653a224a17d (patch)
treeaede73649c957967dcfe86d0121d51f238326ad0 /apps
parentf838730d15b6942d3fc401f73715c8789d05b385 (diff)
check the return value of OPENSSL_strdup to prevent potential memory access error
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17110) (cherry picked from commit dc7e42c6a12637bae1660561d3f4cef039001475)
Diffstat (limited to 'apps')
-rw-r--r--apps/lib/engine_loader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/lib/engine_loader.c b/apps/lib/engine_loader.c
index 2b4480000c..573af76024 100644
--- a/apps/lib/engine_loader.c
+++ b/apps/lib/engine_loader.c
@@ -91,7 +91,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) {