mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-23 21:34:15 +00:00
engine: common: cvar: fix buffer overflow in Cvar_ValidateString
This commit is contained in:
parent
c1c27c5f18
commit
e017b9145f
@ -211,7 +211,7 @@ const char *Cvar_ValidateString( convar_t *var, const char *value )
|
||||
int len = 0;
|
||||
|
||||
// step through the string, only copying back in characters that are printable
|
||||
while( *pszValue && len < MAX_STRING )
|
||||
while( *pszValue && len < ( MAX_STRING - 1 ))
|
||||
{
|
||||
if( ((byte)*pszValue) < 32 )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user