Boundary check
This commit is contained in:
@@ -65,17 +65,18 @@ static void ndpi_search_setup_iax(struct ndpi_detection_module_struct *ndpi_stru
|
|||||||
ndpi_int_iax_add_connection(ndpi_struct, flow);
|
ndpi_int_iax_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
packet_len = 12;
|
packet_len = 12;
|
||||||
for (i = 0; i < NDPI_IAX_MAX_INFORMATION_ELEMENTS; i++) {
|
for(i = 0; i < NDPI_IAX_MAX_INFORMATION_ELEMENTS; i++) {
|
||||||
|
if (packet_len >= packet->payload_packet_len)
|
||||||
|
break;
|
||||||
|
|
||||||
packet_len = packet_len + 2 + packet->payload[packet_len + 1];
|
packet_len = packet_len + 2 + packet->payload[packet_len + 1];
|
||||||
if (packet_len == packet->payload_packet_len) {
|
if(packet_len == packet->payload_packet_len) {
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found IAX\n");
|
NDPI_LOG_INFO(ndpi_struct, "found IAX\n");
|
||||||
ndpi_int_iax_add_connection(ndpi_struct, flow);
|
ndpi_int_iax_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet_len > packet->payload_packet_len) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user