Skip to content

Minor changes to prevent SIGSEGVs

256nil requested to merge 256nil/SRB2:sigsegv-inspection into next

Replace strncpy with memcpy to prevent conditional jump or move depending on uninitialised value(s). Done by using valgrind, @ [m_menu.c:2668]

LUA: Add checks to show a warning if the object being deleted in MobjSpawn hook is the one being spawned (to prevent the game from crashing). The checks are being done within the functions lib_pRemoveMobj and lib_pKillMobj, and the variable that is being used to detect the deletion of the spawning object is a boolean called inside_spawn, and is switched to true at the beginning of P_SpawnMobj. It is turned to false before the object is returned.

Add a check for objects with the flag MF_STICKY touching the sky to prevent them from being deleted if they're a player object. Because otherwise this crashes the game.

Merge request reports

Loading