Improved boundary check to prevent overflow

This commit is contained in:
Luca Deri
2020-09-23 17:14:40 +02:00
parent d29a0241ee
commit 05dfae6430
+1 -1
View File
@@ -68,7 +68,7 @@ static void ndpi_search_setup_iax(struct ndpi_detection_module_struct *ndpi_stru
packet_len = 12;
for(i = 0; i < NDPI_IAX_MAX_INFORMATION_ELEMENTS; i++) {
if (packet_len >= packet->payload_packet_len)
if ((packet_len+1) >= packet->payload_packet_len)
break;
packet_len = packet_len + 2 + packet->payload[packet_len + 1];