Mapster32: fix an oob write in test_map().

git-svn-id: https://svn.eduke32.com/eduke32@5265 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2015-06-07 09:55:41 +00:00
parent 7b6e47f444
commit efe3d87cf8

View file

@ -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));