Fix heap-overflow error in CAPWAP detunneling code
This commit is contained in:
@@ -1810,12 +1810,15 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
/* We dissect ONLY CAPWAP traffic */
|
/* We dissect ONLY CAPWAP traffic */
|
||||||
u_int offset = ip_offset+ip_len+sizeof(struct ndpi_udphdr);
|
u_int offset = ip_offset+ip_len+sizeof(struct ndpi_udphdr);
|
||||||
|
|
||||||
if((offset+40) < header->caplen) {
|
if((offset+1) < header->caplen) {
|
||||||
u_int16_t msg_len = packet[offset+1] >> 1;
|
uint8_t preamble = packet[offset];
|
||||||
|
|
||||||
|
if((preamble & 0x0F) == 0) { /* CAPWAP header */
|
||||||
|
u_int16_t msg_len = (packet[offset+1] & 0xF8) >> 1;
|
||||||
|
|
||||||
offset += msg_len;
|
offset += msg_len;
|
||||||
|
|
||||||
if(packet[offset] == 0x02) {
|
if((offset + 32 < header->caplen) && (packet[offset] == 0x02)) {
|
||||||
/* IEEE 802.11 Data */
|
/* IEEE 802.11 Data */
|
||||||
|
|
||||||
offset += 24;
|
offset += 24;
|
||||||
@@ -1831,6 +1834,7 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* process the packet */
|
/* process the packet */
|
||||||
return(packet_processing(workflow, time, vlan_id, tunnel_type, iph, iph6,
|
return(packet_processing(workflow, time, vlan_id, tunnel_type, iph, iph6,
|
||||||
|
|||||||
Reference in New Issue
Block a user