From d8ec0a9229ce32b3194de4bda3ae11a5203d4df9 Mon Sep 17 00:00:00 2001 From: Stuart Reilly Date: Fri, 28 Jun 2019 16:08:36 +0100 Subject: Move NULL checks to start of functions --- src/lib/protocols/eaq.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/lib/protocols') diff --git a/src/lib/protocols/eaq.c b/src/lib/protocols/eaq.c index 8768cac6f..e86b83181 100644 --- a/src/lib/protocols/eaq.c +++ b/src/lib/protocols/eaq.c @@ -41,7 +41,15 @@ static void ndpi_int_eaq_add_connection(struct ndpi_detection_module_struct *ndp void ndpi_search_eaq(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { + if (!flow) { + return; + } + struct ndpi_packet_struct *packet = &flow->packet; + if (!packet) { + return; + } + u_int16_t sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest); NDPI_LOG_DBG(ndpi_struct, "search eaq\n"); -- cgit v1.2.3