Skip to content
Snippets Groups Projects

Fix segfault when setting forceskin to None

Merged Hanicef requested to merge Hanicef/SRB2Classic:fix-forceskin-none-segfault into next

In a multiplayer game, setting forceskin to None from the settings menu triggered a segfault. This happened because of a special handling of the forceskin variable, where it converts an integer to a string since forceskin does not accept an integer. Problem is that when it's set to None, it's numeric value is -1, which doesn't map to a valid skin and is thus set to NULL. This will then be dereferenced inside the memcpy call and trigger the segfault.

This patch cleans up all logic there and avoids setting the value when it's NULL, which resets the value to it's default value, None.

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