From b6923dc55ad49c7ad890da0f6b71bc8725d01f38 Mon Sep 17 00:00:00 2001 From: Gregor Maier Date: Tue, 23 Aug 2011 22:37:27 -0700 Subject: [PATCH] Fix missing format string that caused some segfaults. Binpac exceptions caught in Analyzer.cc are passed to Reporter::Weird and from there to Reporter::WeirdHelper. WeirdHelper has var args, to support passing them on to DoLog, but there were no forced format strings. Since the binpac exception can contain network data which can contain %-characters, that caused segfaults. --- src/Reporter.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Reporter.cc b/src/Reporter.cc index 053d6370d7..a942067834 100644 --- a/src/Reporter.cc +++ b/src/Reporter.cc @@ -160,17 +160,17 @@ void Reporter::Weird(const char* name) void Reporter::Weird(Connection* conn, const char* name, const char* addl) { - WeirdHelper(conn_weird, conn->BuildConnVal(), name, addl); + WeirdHelper(conn_weird, conn->BuildConnVal(), name, "%s", addl); } void Reporter::Weird(Val* conn_val, const char* name, const char* addl) { - WeirdHelper(conn_weird, conn_val, name, addl); + WeirdHelper(conn_weird, conn_val, name, "%s", addl); } void Reporter::Weird(const uint32* orig, const uint32* resp, const char* name) { - WeirdFlowHelper(orig, resp, name); + WeirdFlowHelper(orig, resp, "%s", name); } void Reporter::DoLog(const char* prefix, EventHandlerPtr event, FILE* out, Connection* conn, val_list* addl, bool location, bool time, const char* fmt, va_list ap)