[PATCH 05/55] FT: Skip Extended Length elements when parsing FT elements

Ilan Peer ilan.peer at intel.com
Thu Dec 3 02:44:04 PST 2026


wpa_ft_parse_ies() treated an Extended Length element as a regular
element with a one octet length, so the following elements were parsed
from wrong offsets. Fix this by skipping such elements.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/common/wpa_common.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c
index 8def15e0e69d..9343acd5db6f 100644
--- a/src/common/wpa_common.c
+++ b/src/common/wpa_common.c
@@ -1472,6 +1472,22 @@ int wpa_ft_parse_ies(const u8 *ies, size_t ies_len, struct wpa_ft_ies *parse,
 	while (end - pos >= 2) {
 		u8 id, len;
 
+		/* Extended Length elements are not parsed here; skip them */
+		if (*pos == WLAN_EID_EXT_LENGTH) {
+			size_t ext_len;
+
+			if (end - pos < 5)
+				break;
+
+			ext_len = WPA_GET_LE16(pos + 3);
+			if (ext_len > (size_t)(end - pos - 5))
+				break;
+
+			pos += 5 + ext_len;
+			is_fte = false;
+			continue;
+		}
+
 		id = *pos++;
 		len = *pos++;
 		if (len > end - pos)
-- 
2.55.0




More information about the Hostap mailing list