Skip to content

Commit

Permalink
output: do not log empty arrays for sid
Browse files Browse the repository at this point in the history
Ticket: OISF#5167
  • Loading branch information
catenacyber committed Jul 1, 2022
1 parent 4adab8f commit 7b6549f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/output-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ void EveFileInfo(JsonBuilder *jb, const File *ff, const bool stored)
{
jb_set_string_from_bytes(jb, "filename", ff->name, ff->name_len);

jb_open_array(jb, "sid");
for (uint32_t i = 0; ff->sid != NULL && i < ff->sid_cnt; i++) {
jb_append_uint(jb, ff->sid[i]);
if (ff->sid_cnt > 0) {
jb_open_array(jb, "sid");
for (uint32_t i = 0; ff->sid != NULL && i < ff->sid_cnt; i++) {
jb_append_uint(jb, ff->sid[i]);
}
jb_close(jb);
}
jb_close(jb);

#ifdef HAVE_MAGIC
if (ff->magic)
Expand Down

0 comments on commit 7b6549f

Please sign in to comment.