]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
log-tlsstore: fix error handling
authorEric Leblond <eric@regit.org>
Fri, 19 May 2017 09:34:38 +0000 (11:34 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 31 May 2017 09:26:56 +0000 (11:26 +0200)
In case of realloc error, the length of the encoding buffer was not
reset and this could result in trying to write to NULL pointer.

src/log-tlsstore.c

index 74d0ec1d27a51b337ce427d38b4d8fc14b926249..79f3c881f618ad4587631435573e9a1c79304604 100644 (file)
@@ -132,6 +132,7 @@ static void LogTlsLogPem(LogTlsStoreLogThread *aft, const Packet *p, SSLState *s
             if (ptmp == NULL) {
                 SCFree(aft->enc_buf);
                 aft->enc_buf = NULL;
+                aft->enc_buf_len = 0;
                 SCLogWarning(SC_ERR_MEM_ALLOC, "Can't allocate data for base64 encoding");
                 goto end_fp;
             }