3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-10-06 11:28:38 +02:00

erp: Avoid potential overflow

When checking that the length is valid, avoid potentially overflowing
'start + len'
This commit is contained in:
Denis Kenzior 2022-01-14 09:48:48 -06:00
parent 5e9178b9de
commit 938e056896

View File

@ -131,7 +131,7 @@ static bool erp_tlv_iter_next(struct erp_tlv_iter *iter)
else else
len = 4; len = 4;
if (tlv + len > end) if (len > end - tlv)
return false; return false;
iter->tag = tag; iter->tag = tag;