From: x2018 Date: Tue, 23 Nov 2021 11:25:43 +0000 (+0800) Subject: check the return value of OPENSSL_strdup to prevent potential memory access error X-Git-Tag: openssl-3.2.0-alpha1~3286 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc7e42c6a12637bae1660561d3f4cef039001475;p=thirdparty%2Fopenssl.git 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) --- 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) {