]> granicus.if.org Git - nethack/commit
fix segfault from splitting 1hp long worm
authornethack.rankin <nethack.rankin>
Sat, 28 Jul 2007 03:26:45 +0000 (03:26 +0000)
committernethack.rankin <nethack.rankin>
Sat, 28 Jul 2007 03:26:45 +0000 (03:26 +0000)
commit03eb70acab772db1a59abe93f279c958024c9729
tree71af2431f7ba369c969feb3f177bbb1db47c1a50
parentaac603a446ec73170efb35c7aca5688928a39d87
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.
doc/fixes34.4
src/worm.c