Merge branch 'mapmusname-fix' into 'next'

Fix mapmusname not overwriting Lua-provided strings (resolves #880)

Closes #880

See merge request STJr/SRB2!1803
This commit is contained in:
LJ Sonic 2022-11-23 09:40:43 +00:00
commit 7454235882

View file

@ -447,7 +447,7 @@ int LUA_CheckGlobals(lua_State *L, const char *word)
if (strlen(str) < strlength)
return luaL_error(L, "string must not contain embedded zeros!");
strncpy(mapmusname, str, strlength);
strlcpy(mapmusname, str, sizeof mapmusname);
}
else if (fastcmp(word, "mapmusflags"))
mapmusflags = (UINT16)luaL_checkinteger(L, 2);