diff options
Diffstat (limited to 'example/reader_util.c')
-rw-r--r-- | example/reader_util.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/example/reader_util.c b/example/reader_util.c index cc44296d7..ae132fcff 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -1518,9 +1518,9 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow, return(nproto); } - if(header->caplen < eth_offset + radio_len + sizeof((struct ndpi_wifi_header)) { - return(nproto); - } + if(header->caplen < (eth_offset + radio_len + sizeof(struct ndpi_wifi_header))) + return(nproto); + /* Calculate 802.11 header length (variable) */ wifi = (struct ndpi_wifi_header*)( packet + eth_offset + radio_len); @@ -1564,7 +1564,7 @@ ether_type_check: vlan_packet = 1; // double tagging for 802.1Q - while((type == 0x8100) && (ip_offset < ((u_int16_t)header->caplen))) { + while((type == 0x8100) && (((bpf_u_int32)ip_offset) < header->caplen)) { vlan_id = ((packet[ip_offset] << 8) + packet[ip_offset+1]) & 0xFFF; type = (packet[ip_offset+2] << 8) + packet[ip_offset+3]; ip_offset += 4; |