From 9968b192c300e08fb8b5322685d429223d6f067c Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 6 Aug 2023 00:39:41 +0300 Subject: [PATCH] engine: server: fix buffer overflow in invalid Q_strncpy call --- engine/server/sv_save.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/server/sv_save.c b/engine/server/sv_save.c index 4b4637ed..fb7d7929 100644 --- a/engine/server/sv_save.c +++ b/engine/server/sv_save.c @@ -2043,12 +2043,12 @@ void SV_ChangeLevel( qboolean loadfromsavedgame, const char *mapname, const char if( start ) { - Q_strncpy( _startspot, start, MAX_STRING ); + Q_strncpy( _startspot, start, sizeof( _startspot )); startspot = _startspot; } - Q_strncpy( level, mapname, MAX_STRING ); - Q_strncpy( oldlevel, sv.name, MAX_STRING ); + Q_strncpy( level, mapname, sizeof( level )); + Q_strncpy( oldlevel, sv.name, sizeof( oldlevel )); if( loadfromsavedgame ) {