Skip to content

Lua bug: Calling P_PlayerInPain on a player without a mobj produces SIGSEGV

An access violation occurs if P_PlayerInPain(player) is called in lua while player.mo does not refer to a valid mobj.

This is because the lib_pPlayerInPain(lua_State *L) does not check player.mo for validity, and the hardcoded P_PlayerInPain(player) attempts to access player.mo without first checking that it exists.