IEEE802_11: Fix buffer-overflow due to not accounting for the amsdu header

The fuzzer generated input where data length left was 14 and the amsdu_len
field set to 14. That caused buffer overread due not taking into account
the amsdu header length of 14.
This commit is contained in:
Arne Welzel 2023-10-18 10:25:34 +02:00
parent a5b94f04fd
commit bccf1a9253

View file

@ -105,7 +105,7 @@ bool IEEE802_11Analyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet*
// This is the length of everything after the A-MSDU subframe header.
size_t amsdu_len = (data[12] << 8) + data[13];
if ( len < amsdu_len )
if ( len < amsdu_len + 14 )
{
Weird("truncated_802_11_amsdu_packet", packet);
return false;