From dd12757493a9c144fbcfe0f91da0cd2cd58d0d88 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Sat, 5 Mar 2016 08:22:04 +0100 Subject: Added check to harden code --- src/lib/ndpi_main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 0d1c21c9e..1b9d4c1f6 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -3196,6 +3196,8 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st struct ndpi_flow_struct *flow) { ndpi_protocol ret = { NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN }; + if(flow == NULL) return(ret); + /* TODO: add the remaining stage_XXXX protocols */ if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) { if(flow->http_detected) -- cgit v1.2.3