Avoid potential read of one or two octets beyond the end of the
subelement when verifying that there is sufficient amount of data
included in each subelement/element within the MLE in Association
Request frames.
Signed-off-by: Jouni Malinen <j@w1.fi>
continue;
}
- if (sub_elem_len < 3) {
+ if (sub_elem_len < 5) {
if (show_errors)
wpa_printf(MSG_DEBUG,
"MLD: error: sub_elem_len=%zu < 5",
non_inherit_len -= 1 + non_inherit[0];
non_inherit += 1 + non_inherit[0];
- if (non_inherit_len < 1UL + non_inherit[0]) {
+ if (non_inherit_len < 1UL ||
+ non_inherit_len < 1UL + non_inherit[0]) {
if (show_errors)
wpa_printf(MSG_DEBUG,
"MLD: Invalid inheritance");