mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Fix large memory allocation in IP fragment reassembly. Addresses #961.
Patch by jbaines modified slightly to return earlier so that the problem packet can't cause any state change in the FragReassembler.
This commit is contained in:
parent
0075973249
commit
8d5434ef2d
1 changed files with 7 additions and 0 deletions
|
@ -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 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue