From 4d1280e1054ce758d19be71f785ec3aff8573b4c Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Sun, 10 May 2020 17:15:00 +0300 Subject: [PATCH] Coverity issue #300971 --- gost_crypt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gost_crypt.c b/gost_crypt.c index ffb577d..6d265a6 100644 --- a/gost_crypt.c +++ b/gost_crypt.c @@ -866,6 +866,9 @@ static int magma_cipher_do_ctr_acpkm_omac(EVP_CIPHER_CTX *ctx, unsigned char *ou if (in == NULL && inl == 0) /* Final call */ return gost2015_final_call(ctx, c->omac_ctx, MAGMA_MAC_MAX_SIZE, c->tag, magma_cipher_do_ctr); + if (in == NULL) + return -1; + /* As in and out can be the same pointer, process unencrypted here */ if (EVP_CIPHER_CTX_encrypting(ctx)) EVP_DigestSignUpdate(c->omac_ctx, in, inl); -- 2.39.5