tls-store: fix bug that causes Suricata to crash

Fix bug that causes Suricata to crash when the tls.store keyword is used.

*** Error in `/usr/bin/suricata': free(): invalid next size (fast):
0x00007fd4b4373180 ***
pull/2494/head
Mats Klepsland 9 years ago committed by Victor Julien
parent 87b5bf9541
commit 03ad9d4ec0

@ -166,7 +166,6 @@ static void LogTlsLogPem(LogTlsStoreLogThread *aft, const Packet *p, SSLState *s
goto end_fwrite_fp;
}
fclose(fp);
SCFree(aft->enc_buf);
//Logging certificate informations
memcpy(filename + (strlen(filename) - 3), "meta", 4);
@ -223,7 +222,6 @@ static void LogTlsLogPem(LogTlsStoreLogThread *aft, const Packet *p, SSLState *s
end_fwrite_fp:
fclose(fp);
SCFree(aft->enc_buf);
if (logging_dir_not_writable < LOGGING_WRITE_ISSUE_LIMIT) {
SCLogWarning(SC_ERR_FWRITE, "Unable to write certificate");
logging_dir_not_writable++;
@ -338,6 +336,9 @@ static TmEcode LogTlsStoreLogThreadDeinit(ThreadVars *t, void *data)
return TM_ECODE_OK;
}
if (aft->enc_buf != NULL)
SCFree(aft->enc_buf);
/* clear memory */
memset(aft, 0, sizeof(LogTlsStoreLogThread));

Loading…
Cancel
Save