3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 04:32:37 +01:00

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

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;