From ea6332e004d6ef0394becda214784c6f06bc95f6 Mon Sep 17 00:00:00 2001 From: Alfredo Cardigliano Date: Tue, 30 Jun 2020 15:54:52 +0200 Subject: Fix segfault on ndpi_guess_protocol_id with flow = null --- src/lib/ndpi_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 957e3b763..41bbf1aeb 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -2421,7 +2421,7 @@ u_int16_t ndpi_guess_protocol_id(struct ndpi_detection_module_struct *ndpi_str, return(NDPI_PROTOCOL_IP_GRE); break; case NDPI_ICMP_PROTOCOL_TYPE: - { + if (flow) { /* Run some basic consistency tests */ if(flow->packet.payload_packet_len < sizeof(struct ndpi_icmphdr)) @@ -2454,7 +2454,7 @@ u_int16_t ndpi_guess_protocol_id(struct ndpi_detection_module_struct *ndpi_str, return(NDPI_PROTOCOL_IP_IP_IN_IP); break; case NDPI_ICMPV6_PROTOCOL_TYPE: - { + if (flow) { /* Run some basic consistency tests */ if(flow->packet.payload_packet_len < sizeof(struct ndpi_icmphdr)) -- cgit v1.2.3