Skip to content

Commit

Permalink
engine: common: cvar: fix buffer overflow in Cvar_ValidateString
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Aug 2, 2023
1 parent c1c27c5 commit e017b91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engine/common/cvar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down

0 comments on commit e017b91

Please sign in to comment.