VLAN: Fix length checking for non-Ethernet type 2 frames

(cherry picked from commit c579eb7b7cf3ca1d9008e74d7934155866c7e4f7)
This commit is contained in:
Tim Wojtulewicz 2023-06-26 11:01:18 -07:00
parent a0c384015a
commit 02af9a9787

View file

@ -38,7 +38,8 @@ bool VLANAnalyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet* packet
len -= 4;
data += 4;
if ( len < protocol )
// Need at least two bytes to check the packet types below.
if ( len < 2 )
{
Weird("truncated_vlan_frame", packet);
return false;