From b2c1dab2da66ef44de120c9d9e5cce3e241ec422 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Fri, 10 Jul 2020 08:23:56 -0400 Subject: [PATCH] output/alert: Correct FORWARD_NULL Coverity issue. This commit corrects the FORWARD_NULL issue in AlertJson by null-checking p->flow --- src/output-json-alert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output-json-alert.c b/src/output-json-alert.c index c796aceee1..113070e6ac 100644 --- a/src/output-json-alert.c +++ b/src/output-json-alert.c @@ -563,7 +563,7 @@ static int AlertJson(ThreadVars *tv, JsonAlertLogThread *aft, const Packet *p) } /* including fileinfo data is configured by the metadata setting */ - if (json_output_ctx->flags & LOG_JSON_RULE_METADATA) { + if (json_output_ctx->flags & LOG_JSON_RULE_METADATA && p->flow != NULL) { FileContainer *ffc = AppLayerParserGetFiles(p->flow, p->flowflags & FLOW_PKT_TOSERVER ? STREAM_TOSERVER:STREAM_TOCLIENT); if (ffc != NULL) {