From 13d99a93901ac6f8da493b9a026c04be96528799 Mon Sep 17 00:00:00 2001 From: Igor Duarte Date: Wed, 21 Oct 2020 10:04:55 -0300 Subject: Remove possible invalid read (#1035) --- src/lib/ndpi_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 4cbe722c2..43ce68699 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -4582,11 +4582,6 @@ ndpi_protocol ndpi_detection_process_packet(struct ndpi_detection_module_struct u_int32_t a, num_calls = 0; ndpi_protocol ret = { NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_CATEGORY_UNSPECIFIED }; - if(flow->fail_with_unknown) { - // printf("%s(): FAIL_WITH_UNKNOWN\n", __FUNCTION__); - return(ret); - } - if(ndpi_str->ndpi_log_level >= NDPI_LOG_TRACE) NDPI_LOG(flow ? flow->detected_protocol_stack[0] : NDPI_PROTOCOL_UNKNOWN, ndpi_str, NDPI_LOG_TRACE, "START packet processing\n"); @@ -4596,6 +4591,11 @@ ndpi_protocol ndpi_detection_process_packet(struct ndpi_detection_module_struct else ret.category = flow->category; + if(flow->fail_with_unknown) { + // printf("%s(): FAIL_WITH_UNKNOWN\n", __FUNCTION__); + return(ret); + } + flow->num_processed_pkts++; /* Init default */ -- cgit v1.2.3