Skip to content

Commit 3b8e18f

Browse files
saltwaterterrapink21971
authored andcommitted
Fix: Possible crash when saving bones after second death
ukiller was not cleared when life-saved, so if you went on to some other level and died again in a way that didn't overwrite ukiller (e.g. a wand zap), then savebones() would encounter the dangling pointer.
1 parent 6bc275f commit 3b8e18f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

doc/evilhack-changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -3600,4 +3600,5 @@ The following changes to date are:
36003600
various objects
36013601
- Fix: feedback when having to drop a worn shield vs worn bracers
36023602
- Fix: Tortle archeologists could never throw Xiuhcoatl
3603+
- Fix: Possible crash when saving bones after second death
36033604

src/end.c

+2
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,8 @@ int how;
10331033
{
10341034
int uhpmin;
10351035

1036+
ukiller = (struct monst *) 0;
1037+
10361038
/* life-drain/level-loss to experience level 0 kills without actually
10371039
reducing ulevel below 1, but include this for bulletproofing */
10381040
if (u.ulevel < 1) {

0 commit comments

Comments
 (0)