]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
tx logging: fix potential missed logging issue
authorVictor Julien <victor@inliniac.net>
Thu, 17 Dec 2015 09:34:17 +0000 (10:34 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 29 Mar 2016 07:50:54 +0000 (09:50 +0200)
Wrong scope of proto_logged variable could potentially lead to
incrementing logged tx id w/o actually being logged.

Reported-By: Jason Ish
src/output-tx.c

index e05c540a076d479a498aa781fb1b2be4e29b3039..ca9216478be1547a51411286119226f5c5990ea3 100644 (file)
@@ -125,10 +125,10 @@ static TmEcode OutputTxLog(ThreadVars *tv, Packet *p, void *thread_data, PacketQ
     int tx_progress_done_value_tc =
         AppLayerParserGetStateProgressCompletionStatus(p->proto, alproto,
                                                        STREAM_TOCLIENT);
-    int proto_logged = 0;
-
     for (; tx_id < total_txs; tx_id++)
     {
+        int proto_logged = 0;
+
         void *tx = AppLayerParserGetTx(p->proto, alproto, alstate, tx_id);
         if (tx == NULL) {
             SCLogDebug("tx is NULL not logging");