Use safe version of sprintf and strcpy

This commit is contained in:
smallmodel committed 2024-09-20 23:08:53 +02:00
1 parent a69d9d4483
commit f9d264058b
87 files changed
+402 -395

No files matched your search

+3 -2
View File
@@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// scriptexception.cpp : Script Exception
#include "scriptexception.h"
#include "q_shared.h"
#include <cstdarg>
@@ -50,7 +51,7 @@ ScriptException::ScriptException(const char *format, ...)
char data[4100];
va_start(va, format);
vsprintf(data, format, va);
Q_vsnprintf(data, sizeof(data), format, va);
va_end(va);
CreateException(data);
@@ -67,7 +68,7 @@ void Error(const char *format, ...)
char data[4100];
va_start(va, format);
vsprintf(data, format, va);
Q_vsnprintf(data, sizeof(data), format, va);
va_end(va);
throw ScriptException((const char *)data);