mirror of
https://github.com/adulau/ssldump.git
synced 2024-11-24 10:27:05 +00:00
Fix for crash if length of captured frame is less than Ethernet header size
This commit is contained in:
parent
d1f8d01d4b
commit
b3316bb5fd
1 changed files with 6 additions and 0 deletions
|
@ -176,6 +176,12 @@ void pcap_cb(ptr,hdr,data)
|
||||||
len-=4;
|
len-=4;
|
||||||
break;
|
break;
|
||||||
case DLT_EN10MB:
|
case DLT_EN10MB:
|
||||||
|
if(len < sizeof(struct ether_header)) {
|
||||||
|
if(!(NET_print_flags & NET_PRINT_JSON))
|
||||||
|
printf("Frame size too small to contain Ethernet header, skipping ...\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
type=ntohs(e_hdr->ether_type);
|
type=ntohs(e_hdr->ether_type);
|
||||||
|
|
||||||
data+=sizeof(struct ether_header);
|
data+=sizeof(struct ether_header);
|
||||||
|
|
Loading…
Reference in a new issue