mirror of
https://github.com/adulau/ssldump.git
synced 2024-12-26 01:46:00 +00:00
Check packet size before looking at IP header
This commit is contained in:
parent
10963dd981
commit
d1f8d01d4b
1 changed files with 6 additions and 0 deletions
|
@ -126,6 +126,12 @@ int network_process_packet(handler,timestamp,data,length)
|
|||
p.len=length;
|
||||
p.ip=(struct ip *)data;
|
||||
|
||||
if(p.len < 20) {
|
||||
if(!(NET_print_flags & NET_PRINT_JSON))
|
||||
printf("Malformed packet, packet too small to contain IP header, skipping ...\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*Handle, or rather mishandle, fragmentation*/
|
||||
off=ntohs(p.ip->ip_off);
|
||||
|
||||
|
|
Loading…
Reference in a new issue