Commit 479a0e20 authored by Sean McBride's avatar Sean McBride

Fixed buffer overrun by using vsnprintf instead of vsprintf

parent 4cb5e34c
......@@ -124,7 +124,7 @@ void vtkTimerLog::FormatAndMarkEvent(const char *format, ...)
static char event[4096];
va_list var_args;
va_start(var_args, format);
vsprintf(event, format, var_args);
vsnprintf(event, sizeof(event), format, var_args);
vtkTimerLog::MarkEventInternal(event, vtkTimerLogEntry::STANDALONE);
......@@ -109,7 +109,7 @@ public:
* Record a timing event. The event is represented by a formatted
* string.
* string. The internal buffer is 4096 bytes and will truncate anything longer.
#ifndef __VTK_WRAP__
static void FormatAndMarkEvent(const char *EventString, ...) VTK_FORMAT_PRINTF(1, 2);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment