Browse Source

engine: common: cvar: fix buffer overflow in Cvar_ValidateString

pull/2/head
Alibek Omarov 1 year ago
parent
commit
e017b9145f
  1. 2
      engine/common/cvar.c

2
engine/common/cvar.c

@ -211,7 +211,7 @@ const char *Cvar_ValidateString( convar_t *var, const char *value ) @@ -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…
Cancel
Save