Fix potential crash TCP headers were captured incompletely.

Test case provided by Jonathan Ganz.

BIT-1425 #close
This commit is contained in:
Robin Sommer 2015-08-30 18:49:05 -07:00
parent d88e6b3f1a
commit 1b9ee38e69
4 changed files with 33 additions and 1 deletions

View file

@ -442,7 +442,7 @@ const struct tcphdr* TCP_Analyzer::ExtractTCP_Header(const u_char*& data,
}
if ( tcp_hdr_len > uint32(len) ||
sizeof(struct tcphdr) > uint32(caplen) )
tcp_hdr_len > uint32(caplen) )
{
// This can happen even with the above test, due to TCP
// options.