replace vsprintf with vsnprintf in CONS_Printf

fixes a buffer overrun that can occur when printing extremely long strings
crash found by Lat, cause diagnosed by X.Organic
This commit is contained in:
K J 2025-08-12 12:50:05 -04:00 committed by NepDisk
parent 8ae23099d1
commit 421099f68e

View file

@ -1252,7 +1252,7 @@ void CONS_Printf(const char *fmt, ...)
txt = malloc(8192);
va_start(argptr, fmt);
vsprintf(txt, fmt, argptr);
vsnprintf(txt, 8192, fmt, argptr);
va_end(argptr);
Lock_state();