Adds different checks against overflows

This commit is contained in:
Philippe Antoine
2020-03-19 16:54:31 +01:00
parent e9195589d2
commit c6acf97bfb
4 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -141,7 +141,7 @@ static int search_valid_dns(struct ndpi_detection_module_struct *ndpi_struct,
/* Leave the statement below commented necessary in case of call to ndpi_get_partial_detection() */
x++;
if(flow->packet.payload[x] != '\0') {
if(x < flow->packet.payload_packet_len && flow->packet.payload[x] != '\0') {
while((x < flow->packet.payload_packet_len)
&& (flow->packet.payload[x] != '\0')) {
x++;