]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
eve/json/xff - remove check for flow being NULL. 3372/head
authorJason Ish <ish@unx.ca>
Wed, 9 May 2018 12:50:03 +0000 (06:50 -0600)
committerJason Ish <ish@unx.ca>
Wed, 9 May 2018 12:50:03 +0000 (06:50 -0600)
Fix Coverity issue:
** CID 1435535:  Null pointer dereferences  (REVERSE_INULL)
/src/output-json-file.c: 212 in JsonBuildFileInfoRecord()

Where we check a variable for being NULL, when all paths to the
code show that it can't be NULL.

src/output-json-file.c

index 56d3f565897e03056cc88085d7c8aeb398d7381e..29e70a7b559c268738da7056fb408614217f6437 100644 (file)
@@ -209,7 +209,7 @@ json_t *JsonBuildFileInfoRecord(const Packet *p, const File *ff,
     json_object_set_new(fjs, "tx_id", json_integer(ff->txid));
 
     /* xff header */
-    if ((xff_cfg != NULL) && !(xff_cfg->flags & XFF_DISABLED) && p->flow != NULL) {
+    if ((xff_cfg != NULL) && !(xff_cfg->flags & XFF_DISABLED)) {
         int have_xff_ip = 0;
         char buffer[XFF_MAXLEN];