diff options
author | Luca Deri <lucaderi@users.noreply.github.com> | 2018-09-11 10:04:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-11 10:04:15 +0300 |
commit | 7b4d3359446ee0cb53328ddbfc448cae8a036eb2 (patch) | |
tree | 926acb791bed0e3accafdd4a3afb1005cf8ccea9 /src | |
parent | 9bf05c35345af7d161301bf5144b854ee5d1da70 (diff) | |
parent | 77ea1c25bd423b4d4e2cf455fdb686c2204276aa (diff) |
Merge pull request #603 from pavlosantoniou/dev
Avoid possible NULL pointer dereference in ndpi_detection_process_packet
Diffstat (limited to 'src')
-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 ebc209f68..b00225c7c 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -4228,14 +4228,14 @@ ndpi_protocol ndpi_detection_process_packet(struct ndpi_detection_module_struct u_int32_t a; ndpi_protocol ret = { NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_CATEGORY_UNSPECIFIED }; - flow->num_processed_pkts++; - if(ndpi_struct->ndpi_log_level >= NDPI_LOG_TRACE) NDPI_LOG(flow ? flow->detected_protocol_stack[0]:NDPI_PROTOCOL_UNKNOWN, ndpi_struct, NDPI_LOG_TRACE, "START packet processing\n"); if(flow == NULL) return(ret); + flow->num_processed_pkts++; + if(flow->server_id == NULL) flow->server_id = dst; /* Default */ if(flow->detected_protocol_stack[0] != NDPI_PROTOCOL_UNKNOWN) goto ret_protocols; |