fix github issue #309 - random role segfault
Role selection is insanely complex. I had to use a debugger to force the relevant routine to be executed. The analysis was correct: it could use rn2(14) to pick a role (valid values 0 through 12) and randomly getting 13 would lead to a crash. The terminating element of roles[] passes all the ok_role(), ok_race(), etc tests. Explicitly exclude that element when collecting the roles to choose from.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.114 $ $NHDT-Date: 1583073988 2020/03/01 14:46:28 $
|
||||
$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.115 $ $NHDT-Date: 1583102142 2020/03/01 22:35:42 $
|
||||
|
||||
General Fixes and Modified Features
|
||||
-----------------------------------
|
||||
@@ -60,6 +60,7 @@ prevent ravens from blinding other ravens: /corvus oculum corvi non eruit/
|
||||
have ^X provide more information when held or swallowed
|
||||
avoid divide by 0 crash if 'bogusmon' (file of bogus monster types) is empty
|
||||
display wasn't updating immediately after toggling hilite_pet option
|
||||
randomly choosing role could lead to crash via segfault
|
||||
|
||||
|
||||
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
||||
|
||||
Reference in New Issue
Block a user