Skip to content
Snippets Groups Projects

Fix segfault when going up steep slopes in rare cases

Merged Hanicef requested to merge Hanicef/SRB2Classic:fix-null-standingslope into next

In a few rare cases, it's possible for the game to crash when going up steep slopes. This happens because of NULL dereference within P_GetWallTransferMomZ, where a check that verifies if a slope have physics set or not. On that check, the code incorrectly checks mo->standingslope instead of the slope variable, where the former has a risk of being NULL. The callee site already checks that NULL value and uses oldslope as a fallback, which is what slope is being set to: https://git.do.srb2.org/STJr/SRB2/-/blob/next/src/p_mobj.c#L1906-L1911

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
Please register or sign in to reply
Loading