From: Mats Klepsland Date: Thu, 19 Sep 2019 21:10:48 +0000 (+0200) Subject: tls-log: fix so buffer is reset on custom logging X-Git-Tag: suricata-5.0.0-rc1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85536e89182207763a7883587a47c69cfb504248;p=thirdparty%2Fsuricata.git 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 --- 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:",