crypto: fix uninitialized variable coverity warning

Same as for aes_siv_decrypt, check num_ads before calling memcpy.
This commit is contained in:
James Prestwood 2024-02-27 13:16:17 -08:00 committed by Denis Kenzior
parent ee52968043
commit 14aa333a39
1 changed files with 1 additions and 1 deletions

View File

@ -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;