]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
tls-log: fix so buffer is reset on custom logging
authorMats Klepsland <mats.klepsland@gmail.com>
Thu, 19 Sep 2019 21:10:48 +0000 (23:10 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 23 Sep 2019 12:13:11 +0000 (14:13 +0200)
Move MemBufferReset() so it also works when using custom tls
logging. This avoids duplicate tls log entries.

Bug #3177

src/log-tlslog.c

index b9518aeaf1f581875dcab597170f97067ec2fc43..f368b14714b4e328a666587db00d67f4fcf8dd69 100644 (file)
@@ -451,12 +451,12 @@ static int LogTlsLogger(ThreadVars *tv, void *thread_data, const Packet *p,
         return 0;
     }
 
+    MemBufferReset(aft->buffer);
+
     /* Custom format */
     if (hlog->flags & LOG_TLS_CUSTOM) {
         LogTlsLogCustom(aft, ssl_state, &p->ts, srcip, sp, dstip, dp);
     } else {
-
-        MemBufferReset(aft->buffer);
         CreateTimeString(&p->ts, timebuf, sizeof(timebuf));
         MemBufferWriteString(aft->buffer,
                              "%s %s:%d -> %s:%d  TLS:",