]> git.ipfire.org Git - thirdparty/suricata.git/commit
output-json: fix duplicate logging 1266/head
authorEric Leblond <eric@regit.org>
Mon, 15 Dec 2014 23:14:59 +0000 (00:14 +0100)
committerEric Leblond <eric@regit.org>
Wed, 17 Dec 2014 11:07:55 +0000 (12:07 +0100)
commit63ef0d52267150bf3086f73c7dec1298f736aa39
treebe9d29692782e0fc75bf6afd44cf9a95caaba434
parent090ae0c6bee2230f4ffa03ff9826781bec241573
output-json: fix duplicate logging

This patches is fixing a issue in the OutputJSONBuffer function. It
was writing to file the content of the buffer starting from the start
to the final offset. But as the writing is done for each JSON string
we are duplicating the previous events if we are reusing the same
buffer.

Duplication was for example triggered when we have multiple alerts
attached to a packet. In the case of two alerts, the first one was
logged twice more as the second one.

This si almost the same code as the one of master but it fixes a
conflict during cherry picking in:
src/output-json-alert.c
src/output-json-alert.c