diff options
author | Igor Duarte <igor.ribeiro.duarte@gmail.com> | 2020-10-21 10:04:55 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-21 15:04:55 +0200 |
commit | 13d99a93901ac6f8da493b9a026c04be96528799 (patch) | |
tree | f4e0dde97ca113fad138bbbd3b935a8b1014c21a | |
parent | 6c0a809de89cc4bdb1f734fa7536bf9c6ccd454a (diff) |
Remove possible invalid read (#1035)
-rw-r--r-- | src/lib/ndpi_main.c | 10 |
1 files changed, 5 insertions, 5 deletions
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 */ |