From 085f1d11a01e62c5abfe6486ee9dce00a808d977 Mon Sep 17 00:00:00 2001 From: Pauli Date: Sun, 8 Sep 2019 18:33:12 +1000 Subject: [PATCH] Coverity 1453630: Null pointer dereferences (FORWARD_NULL) Reviewed-by: Bernd Edlinger (Merged from https://github.com/openssl/openssl/pull/9805) --- providers/common/macs/gmac_prov.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/providers/common/macs/gmac_prov.c b/providers/common/macs/gmac_prov.c index 2da176d8b0..67f3e48407 100644 --- a/providers/common/macs/gmac_prov.c +++ b/providers/common/macs/gmac_prov.c @@ -174,7 +174,8 @@ static int gmac_set_ctx_params(void *vmacctx, const OSSL_PARAM params[]) OPENSSL_CTX *provctx = PROV_LIBRARY_CONTEXT_OF(macctx->provctx); const OSSL_PARAM *p; - if (!ossl_prov_cipher_load_from_params(&macctx->cipher, params, provctx)) + if (ctx == NULL + || !ossl_prov_cipher_load_from_params(&macctx->cipher, params, provctx)) return 0; if (EVP_CIPHER_mode(ossl_prov_cipher_cipher(&macctx->cipher)) -- 2.25.1