aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/eaq.c
diff options
context:
space:
mode:
authorStuart Reilly <rs576h@vyatta.att-mail.com>2019-06-28 16:08:36 +0100
committerStuart Reilly <rs576h@vyatta.att-mail.com>2019-06-28 16:08:36 +0100
commitd8ec0a9229ce32b3194de4bda3ae11a5203d4df9 (patch)
tree46f90d5e2d6c7695a153ba293418731b18415a7a /src/lib/protocols/eaq.c
parentbc1b4885de3a80accda894c51c361e2009d54210 (diff)
Move NULL checks to start of functions
Diffstat (limited to 'src/lib/protocols/eaq.c')
-rw-r--r--src/lib/protocols/eaq.c8
1 files changed, 8 insertions, 0 deletions
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");