commit 14aa333a3986bf501962d1a2f2d585894010b42c
parent ee52968043048e706b317855ce92bc9e9c8320c9
Author: James Prestwood <prestwoj@gmail.com>
Date: Tue, 27 Feb 2024 13:16:17 -0800
crypto: fix uninitialized variable coverity warning
Same as for aes_siv_decrypt, check num_ads before calling memcpy.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/crypto.c b/src/crypto.c
@@ -390,7 +390,7 @@ bool aes_siv_decrypt(const void *key, size_t key_len, const void *in,
if (in_len < 16)
return false;
- if (ad)
+ if (ad && num_ad)
memcpy(iov, ad, sizeof(struct iovec) * num_ad);
iov[num_ad].iov_base = (void *)out;