mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
Merge remote-tracking branch 'origin/topic/timw/fix-ip-header-length-checking'
* origin/topic/timw/fix-ip-header-length-checking: Fix handling of IP packets with bogus IP header lengths
This commit is contained in:
commit
d15fca7e17
5 changed files with 24 additions and 1 deletions
|
@ -235,6 +235,13 @@ bool IPAnalyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet* packet)
|
|||
|
||||
packet->proto = proto;
|
||||
|
||||
// Double check the lengths one more time before forwarding this on.
|
||||
if ( packet->ip_hdr->TotalLen() < packet->ip_hdr->HdrLen() )
|
||||
{
|
||||
Weird("bogus_IP_header_lengths", packet);
|
||||
return false;
|
||||
}
|
||||
|
||||
switch ( proto ) {
|
||||
case IPPROTO_NONE:
|
||||
// If the packet is encapsulated in Teredo, then it was a bubble and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue