From: Bruno.Kremp@sony.com Date: Fri, 19 Dec 2025 10:25:46 +0000 (+0000) Subject: Add an explicit check for MLE subelement defragmentation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f44d47e3f6abfd7a7ee6f48ae85042bd317299e;p=thirdparty%2Fhostap.git Add an explicit check for MLE subelement defragmentation While the ieee802_11_defrag_mle_subelem() checks that the subelements are present, an explicit check for the length in the caller makes this more obvious. Signed-off-by: Bruno Kremp --- diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c index 5bcab11df..387c417a6 100644 --- a/src/common/ieee802_11_common.c +++ b/src/common/ieee802_11_common.c @@ -1042,7 +1042,8 @@ ParseRes ieee802_11_parse_link_assoc_req(struct ieee802_11_elems *elems, "MLD: Failed to parse MLE subelem"); goto out; } - + if ((size_t) num_frag_subelems * 2 > len) + goto out; len -= num_frag_subelems * 2; wpa_printf(MSG_DEBUG,