fix segfault from splitting 1hp long worm

Fix the crash From a bug report, where
having the hit that cuts a long worm into two also take the original down
to 1 HP would result in clone_mon() returning null and nethack crashing due
to a segmentation fault or access violation.  The same thing could happen
if there's been enough long worms created to get them flagged as extinct.

     This bug was only present in 3.4.3.  Prior to that, cut_worm() did
its own monster creation inline instead of calling clone_mon(), ignoring
extinction and too-low hit points.
This commit is contained in:
nethack.rankin
2007-07-28 03:26:45 +00:00
parent aac603a446
commit 03eb70acab
2 changed files with 18 additions and 6 deletions

View File

@@ -361,6 +361,8 @@ monsters who want the Amulet won't attack the Wizard to try to get it
opening or closing the castle drawbridge via music consumes a turn
could get "suddenly you cannot see the <mon>" while invisible mon remained
displayed due to telepathy or extended detection
cutting a long worm in half would trigger segfault/accvio crash if the hit
took parent down to 1 hit point or if long worms had become extinct
Platform- and/or Interface-Specific Fixes