mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath: Add check for truncated link frames. Addresses #962. Fix large memory allocation in IP fragment reassembly. Addresses #961.
This commit is contained in:
commit
b4824f4207
4 changed files with 22 additions and 1 deletions
8
CHANGES
8
CHANGES
|
@ -1,4 +1,12 @@
|
|||
|
||||
2.1-361 | 2013-03-13 07:18:22 -0700
|
||||
|
||||
* Add check for truncated link frames. Addresses #962. (Jacob
|
||||
Baines)
|
||||
|
||||
* Fix large memory allocation in IP fragment reassembly. Addresses
|
||||
#961. (Jacob Baines)
|
||||
|
||||
2.1-357 | 2013-03-08 09:18:35 -0800
|
||||
|
||||
* Fix race-condition in table-event test. (Bernhard Amann)
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
2.1-357
|
||||
2.1-361
|
||||
|
|
|
@ -100,6 +100,13 @@ void FragReassembler::AddFragment(double t, const IP_Hdr* ip, const u_char* pkt)
|
|||
int offset = ip->FragOffset();
|
||||
int len = ip->TotalLen();
|
||||
int hdr_len = ip->HdrLen();
|
||||
|
||||
if ( len < hdr_len )
|
||||
{
|
||||
s->Weird("fragment_protocol_inconsistency", ip);
|
||||
return;
|
||||
}
|
||||
|
||||
int upper_seq = offset + len - hdr_len;
|
||||
|
||||
if ( ! offset )
|
||||
|
|
|
@ -223,6 +223,12 @@ void NetSessions::NextPacket(double t, const struct pcap_pkthdr* hdr,
|
|||
// we look to see if what we have is consistent with an
|
||||
// IPv4 packet. If not, it's either ARP or IPv6 or weird.
|
||||
|
||||
if ( hdr_size > static_cast<int>(hdr->caplen) )
|
||||
{
|
||||
Weird("truncated_link_frame", hdr, pkt);
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 caplen = hdr->caplen - hdr_size;
|
||||
if ( caplen < sizeof(struct ip) )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue