From a2ddce6cbbcf7dfe726278f6d2c0da6a09350e6d Mon Sep 17 00:00:00 2001 From: Sergei Ianovich Date: Tue, 30 Jul 2024 14:55:22 +0000 Subject: [PATCH] Fix false positive static analysis issue #2 Infer complains: ``` test_digest.c:662: error: Dead Store The value written to `&p` is never used. 660. if (t->truncate) { 661. outsize = t->truncate; 662. params[p++] = OSSL_PARAM_construct_size_t("size", &outsize); ^ 663. } 664. else ``` Altough the complain is false positive, fixing it will allow for future use of the tools in automated tests. --- test_digest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test_digest.c b/test_digest.c index 68c0e32..9b981f1 100644 --- a/test_digest.c +++ b/test_digest.c @@ -663,6 +663,7 @@ static int do_mac(int iter, EVP_MAC *mac, const char *plaintext, } else outsize = EVP_MAC_CTX_get_mac_size(ctx); + T(p - params < 4); T(EVP_MAC_init(ctx, (const unsigned char *)t->key, t->key_size, NULL)); T(EVP_MAC_CTX_set_params(ctx, params)); -- 2.39.5