From: PatR Date: Mon, 28 Jan 2019 17:10:52 +0000 (-0800) Subject: fix #H8072 - failing wish segfaults X-Git-Tag: NetHack-3.6.2_Released~80^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30237c73ec911e9160940c5575d54ec0c75c6c50;p=nethack fix #H8072 - failing wish segfaults Having an artifact wish be refused uses zeroobj and code which followed was attempting to update its weight, triggering a segfault now that zeroobj is 'const'. --- diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 12e3b9384..c2c5c462d 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.237 $ $NHDT-Date: 1548631703 2019/01/27 23:28:23 $ +$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.239 $ $NHDT-Date: 1548695445 2019/01/28 17:10:45 $ This fixes36.2 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.1 in April 2018. Please note, however, @@ -410,6 +410,8 @@ when engulfed while in a shop, dropping an item into the engulfer and then using ':' to look at current location could cause a crash when items were on the floor just inside a shop's door where the shopkeeper doesn't buy and sell stuff, those items showed a 'for sale' price +having an artifact wish be refused ("for a moment you feel in + your hands, but it disappears") would immediately segfault tty: turn off an optimization that is the suspected cause of Windows reported partial status lines following level changes tty: ensure that current status fields are always copied to prior status diff --git a/src/objnam.c b/src/objnam.c index 0081b7267..cfb1a3e15 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 objnam.c $NHDT-Date: 1547025168 2019/01/09 09:12:48 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.233 $ */ +/* NetHack 3.6 objnam.c $NHDT-Date: 1548695445 2019/01/28 17:10:45 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.234 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3984,6 +3984,7 @@ struct obj *no_wish; otmp = (struct obj *) &zeroobj; pline("For a moment, you feel %s in your %s, but it disappears!", something, makeplural(body_part(HAND))); + return otmp; } if (halfeaten && otmp->oclass == FOOD_CLASS) {