Fix buffer overflow when setting a NETVAR string CVar

There was a possible buffer overflow if you tried setting a console var
that had the CV_NETVAR and that was of the string type.
The overflow would happen if you were trying to set the console variable
while in a multiplayer / netgame state.

This commit just increases the size of buf to account for everything
that needs to be written to it.
This commit is contained in:
Refrag 2024-05-15 20:03:04 +02:00
parent c2b57e2654
commit 68264e7288
No known key found for this signature in database
GPG key ID: AD08F6A1C3E283FD

View file

@ -1992,7 +1992,7 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth)
if (var->flags & CV_NETVAR)
{
// send the value of the variable
UINT8 buf[128];
UINT8 buf[512];
UINT8 *p = buf;
// Loading from a config in a netgame? Set revert value.