cxong / cdogs-sdl

Classic overhead run-and-gun game
https://cxong.github.io/cdogs-sdl/
GNU General Public License v2.0
891 stars 114 forks source link

Wreck causes segfault due to null pointer being read from wreck object in obj.c #480

Closed grimpunch closed 7 years ago

grimpunch commented 7 years ago

In the process of refactoring my implementation for my PR for #478, I discovered a crash when map objects generate wrecks on certain maps.

Repro Steps:

  1. Select Start
  2. Select Campaign
  3. Select the "AI Insurgency" campaign
  4. Advance through menus and Start Campaign
  5. Select a projectile weapon (machine pistol) in weapon selection.
  6. Move Left in to first room and shoot at desk with computer on top of desk.
  7. Observe segfault

I git-bisected my way back from master to the the last release build to determine when this was introduced and I believe I found the commit.

issue introduced in commit : 1b6fb4b251080de1f5e4ffbd240232505a3f0fa3

grimpunch commented 7 years ago

I think I found what was causing the crash , further details here: https://github.com/cxong/cdogs-sdl/commit/1b6fb4b251080de1f5e4ffbd240232505a3f0fa3#commitcomment-20746190