Browse Source

engine: server: fix buffer overflow in invalid Q_strncpy call

pull/2/head
Alibek Omarov 1 year ago
parent
commit
9968b192c3
  1. 6
      engine/server/sv_save.c

6
engine/server/sv_save.c

@ -2043,12 +2043,12 @@ void SV_ChangeLevel( qboolean loadfromsavedgame, const char *mapname, const char
if( start ) if( start )
{ {
Q_strncpy( _startspot, start, MAX_STRING ); Q_strncpy( _startspot, start, sizeof( _startspot ));
startspot = _startspot; startspot = _startspot;
} }
Q_strncpy( level, mapname, MAX_STRING ); Q_strncpy( level, mapname, sizeof( level ));
Q_strncpy( oldlevel, sv.name, MAX_STRING ); Q_strncpy( oldlevel, sv.name, sizeof( oldlevel ));
if( loadfromsavedgame ) if( loadfromsavedgame )
{ {

Loading…
Cancel
Save