eap-ttls: 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 08:57:27 -06:00
parent 01960ec66e
commit 22faf3482c
1 changed files with 1 additions and 1 deletions

View File

@ -375,7 +375,7 @@ static bool avp_iter_next(struct avp_iter *iter)
len -= TTLS_AVP_HEADER_LEN;
if (start + len > end)
if (len > end - start)
return false;
if (flags & TTLS_AVP_FLAG_V) {