[Listener] Check radiotap header length
From time to time, the length of the radiotap header (rtap_bytes in read_packet()) is 65535. This is a quick & dirty fix to avoid segfaults, but we should search for the reason why this value sometimes appears.
This commit is contained in:
parent
08a8626354
commit
7fc89a381c
|
@ -855,6 +855,9 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
|
|||
memcpy(&rtap_bytes, &packet[2], sizeof(rtap_bytes)) ;
|
||||
// Radiotap header is little-endian
|
||||
rtap_bytes = le16toh(rtap_bytes) ;
|
||||
// Check rtap_bytes for buggy values
|
||||
if (rtap_bytes > 100)
|
||||
return ;
|
||||
|
||||
// After the rtap header, there is the 802.11 header; the first byte
|
||||
// is the first byte of the Frame Control (FC) field, which contains
|
||||
|
|
Loading…
Reference in New Issue