null pointer crash fix

The fix to try to avoid messages about out-of-view objects taking
erosion damage made water_damage_chain() vulnerable to dereferencing
a null pointer, leading to a crash if you create a pool via wizard
mode wishing.
This commit is contained in:
PatR
2020-04-08 14:53:06 -07:00
parent 6582b90008
commit 69b4f0afc0
2 changed files with 6 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.170 $ $NHDT-Date: 1586375530 2020/04/08 19:52:10 $
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.171 $ $NHDT-Date: 1586382777 2020/04/08 21:52:57 $
General Fixes and Modified Features
-----------------------------------
@@ -167,6 +167,7 @@ fix door created into random wall or position opening into solid wall
'use_inverse' option was accidentally made Windows-only; change it back to
being more general; change its default to True
change inconsistent achievement spelling of "Mine Town" to "Minetown"
fix crash in water_damage_chain
X11: was still initializing map to 'stone' instead of 'unexplored' after they
became separate glyphs
X11: for text map without color, add support for black&white ice; draw it in

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 trap.c $NHDT-Date: 1586285683 2020/04/07 18:54:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.357 $ */
/* NetHack 3.6 trap.c $NHDT-Date: 1586382778 2020/04/08 21:52:58 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.358 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3682,6 +3682,9 @@ boolean here;
struct obj *otmp;
xchar x, y;
if (!obj)
return;
/* initialize acid context: so far, neither seen (dknown) potions of
acid nor unseen have exploded during this water damage sequence */
g.acid_ctx.dkn_boom = g.acid_ctx.unk_boom = 0;