engine: client: fix buffer overflow in S_FindName

This commit is contained in:
Alibek Omarov 2024-05-06 06:42:47 +03:00
parent 5d718aa0d6
commit e754de46d1
1 changed files with 1 additions and 1 deletions

View File

@ -221,7 +221,7 @@ sfx_t *S_FindName( const char *pname, int *pfInCache )
sfx = &s_knownSfx[i];
memset( sfx, 0, sizeof( *sfx ));
if( pfInCache ) *pfInCache = false;
Q_strncpy( sfx->name, name, MAX_STRING );
Q_strncpy( sfx->name, name, sizeof( sfx->name ));
sfx->servercount = cl.servercount;
sfx->hashValue = COM_HashKey( sfx->name, MAX_SFX_HASH );