From 58e6c0afedf00f686f44a3f473863311fbc55bf3 Mon Sep 17 00:00:00 2001 From: Mats Klepsland Date: Thu, 19 Sep 2019 23:10:48 +0200 Subject: [PATCH] tls-log: fix so buffer is reset on custom logging Move MemBufferReset() so it also works when using custom tls logging. This avoids duplicate tls log entries. Bug #3177 --- src/log-tlslog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/log-tlslog.c b/src/log-tlslog.c index b9518aeaf1..f368b14714 100644 --- a/src/log-tlslog.c +++ b/src/log-tlslog.c @@ -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:", -- 2.47.2