]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix ieee802_11_defrag_mle_subelem() check on remaining buffer
authorBruno.Kremp@sony.com <Bruno.Kremp@sony.com>
Fri, 19 Dec 2025 10:25:46 +0000 (10:25 +0000)
committerJouni Malinen <j@w1.fi>
Sat, 24 Jan 2026 17:41:14 +0000 (19:41 +0200)
The end pointer moves as well when cutting out a subelement
header. While the previous version checked against the original full
buffer, it is more accurate to check against the updated end of the
buffer.

Signed-off-by: Bruno Kremp <bruno.kremp@sony.com>
src/common/ieee802_11_common.c

index 5d1e02f81e1ec53ec58f2b3221ef98fe52f27397..5bcab11df7ccc0fe7c6faed1ae4d1b1b4bbadd44 100644 (file)
@@ -3524,6 +3524,7 @@ ssize_t ieee802_11_defrag_mle_subelem(struct wpabuf *mlbuf,
                        return -1;
 
                os_memmove(pos, pos + 2, end - (pos + 2));
+               end -= 2;
                pos += elen - 2;
                subelem_len += elen - 2;