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
1 changed files with 1 additions and 1 deletions

View File

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