Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent item controller generated corpses from becoming game crashing bombs: add itype.corpse, default to mon_null (human). Replace typeId string cmp with pointer NULL check prior to using pointer #2527

Merged

Conversation

Projects
None yet
3 participants
@atomicdryad
Copy link
Contributor

commented Aug 19, 2013

This is evident in spider caves, which can lead to inevitable crash via:
mapgen(ot_spider_pit_under) -> place_items("spider") -> item_groups.json("corpse") -> spawn_item -> item_controller->create -> itype("corpse"),
which does not fill in "corpse" variable'. Eventually when this bogus corpse is parsed via map::drawsq -> item.color, segfault.

This is also due to functions in item.cpp checking 'typeId() == "corpse"', instead of 'corpse != NULL'

atomicdryad added some commits Aug 19, 2013

Prevent item controller generated corpses from becoming game crashing…
… bombs: add itype.corpse. Corpses default to mon_null (human).

This is evident in spider caves, which can lead to inevitable crash via:
mapgen(ot_spider_pit_under) -> place_items("spider") -> item_groups.json("corpse") -> spawn_item -> item_controller->create -> itype("corpse"),
  which does not fill in "corpse" variable'. Eventually when this bogus corpse is parsed via map::drawsq -> item.color, segfault.

This is also due to functions in item.cpp checking 'typeId() == "corpse"', instead of 'corpse != NULL'
@CataJenkins

This comment has been minimized.

Copy link

commented Aug 19, 2013

Build successful!
Refer to this link for build results: http://ci.narc.ro/job/Cataclysm-PullRequests/438/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.