Coverity 1453630: Null pointer dereferences (FORWARD_NULL)
authorPauli <paul.dale@oracle.com>
Sun, 8 Sep 2019 08:33:12 +0000 (18:33 +1000)
committerPauli <paul.dale@oracle.com>
Tue, 10 Sep 2019 22:27:26 +0000 (08:27 +1000)
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/9805)

providers/common/macs/gmac_prov.c

index 2da176d8b01ab3138dd9d5a46ddeb071a7d4c7fe..67f3e484071190c1b06a8ac32312ab73d4da4265 100644 (file)
@@ -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))