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.
This commit is contained in:
Gregor Maier 2011-08-23 22:37:27 -07:00 committed by Robin Sommer
parent 5b6cc7fe0f
commit b6923dc55a

View file

@ -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)