From efe3d87cf80447d58b0379b9ec9020a432db8c4e Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 7 Jun 2015 09:55:41 +0000 Subject: [PATCH] Mapster32: fix an oob write in test_map(). git-svn-id: https://svn.eduke32.com/eduke32@5265 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/build.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index a431aa303..74bbd55d0 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -10757,8 +10757,7 @@ void test_map(int32_t mode) { slen = fullparam-mapster32_fullpath+1; Bstrncpy(game_executable, mapster32_fullpath, slen); - // game_executable is now expected to not be NULL-terminated! - Bstrncpy(game_executable+slen, DefaultGameExec, sizeof(game_executable)); + Bstrncpy(game_executable+slen, DefaultGameExec, sizeof(game_executable)-slen); } else Bstrncpy(game_executable, DefaultGameLocalExec, sizeof(game_executable));