In Optick Core::DumpProgressFormatted() use vsnprintf() vs. vsprintf() for non-MSVC compilers

This commit is contained in:
Stephen Saunders 2023-06-23 16:02:32 -04:00
parent 99d9868bd9
commit 02eda6f1d1

View file

@ -840,7 +840,8 @@ void Core::DumpProgressFormatted(const char* format, ...)
#ifdef OPTICK_MSVC
vsprintf_s(buffer, format, arglist);
#else
vsprintf(buffer, format, arglist);
// SRS - use vsnprintf() for buffer security and to eliminate warning
vsnprintf(buffer, sizeof(buffer), format, arglist);
#endif
va_end(arglist);
DumpProgress(buffer);