From: Eric Leblond Date: Fri, 19 May 2017 09:34:38 +0000 (+0200) Subject: log-tlsstore: fix error handling X-Git-Tag: suricata-4.0.0-beta1~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1655a676546cbbf699c567811c904c3f3debd3e3;p=thirdparty%2Fsuricata.git log-tlsstore: fix error handling 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. --- diff --git a/src/log-tlsstore.c b/src/log-tlsstore.c index 74d0ec1d27..79f3c881f6 100644 --- a/src/log-tlsstore.c +++ b/src/log-tlsstore.c @@ -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; }