diff options
author | Alfredo Cardigliano <cardigliano@ntop.org> | 2020-06-30 15:54:52 +0200 |
---|---|---|
committer | Alfredo Cardigliano <cardigliano@ntop.org> | 2020-06-30 15:54:52 +0200 |
commit | ea6332e004d6ef0394becda214784c6f06bc95f6 (patch) | |
tree | d77fb4d0d2b176674381add4e5ee0aae48a91dda /src/lib/ndpi_main.c | |
parent | 392ce445737b0cb7469775458596b52a52198b7e (diff) |
Fix segfault on ndpi_guess_protocol_id with flow = null
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
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)) |