summaryrefslogtreecommitdiff
path: root/examples/c-collectd/c-collectd.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2022-09-23 00:13:19 +0200
committerToni Uhlig <matzeton@googlemail.com>2022-09-23 00:13:19 +0200
commit36f1786bde2572cf7eb44aa1384b61ecfebdeff3 (patch)
tree83d4f3d5abc6d19ee4df1686c4cad7655cd1b335 /examples/c-collectd/c-collectd.c
parent9a28475bba88b711b7075b58473b7e5b5df1f393 (diff)
nDPIsrvd.h: Fixed bug during token parsing/hashing. Do not hash array contents.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples/c-collectd/c-collectd.c')
-rw-r--r--examples/c-collectd/c-collectd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/c-collectd/c-collectd.c b/examples/c-collectd/c-collectd.c
index 811eeee08..fbad4d2e5 100644
--- a/examples/c-collectd/c-collectd.c
+++ b/examples/c-collectd/c-collectd.c
@@ -457,10 +457,14 @@ static enum nDPIsrvd_callback_return captured_json_callback(struct nDPIsrvd_sock
(void)sock;
(void)instance;
(void)thread_data;
- (void)flow;
struct nDPIsrvd_json_token const * const flow_event_name = TOKEN_GET_SZ(sock, "flow_event_name");
- struct flow_user_data * const flow_user_data = (struct flow_user_data *)flow->flow_user_data;
+ struct flow_user_data * flow_user_data = NULL;
+
+ if (flow != NULL)
+ {
+ flow_user_data = (struct flow_user_data *)flow->flow_user_data;
+ }
if (flow_user_data != NULL)
{