Today I have discovered a second segmentation fault in /usr/games/hack.
In particular, if a game is saved while a potion of levitation is in
effect, then the restored game may crash when the potion wears off.
This problem is caused by the same sort of issue that caused the
previously-reported segmentation fault.  A patch for this new
segmentation fault is included below.

This patch, together with my previous two patches

 http://marc.info/?l=openbsd-tech&m=152028167232634
 http://marc.info/?l=openbsd-tech&m=152020888711960

are all that is needed to fix /usr/games/hack on OpenBSD 6.2.  The
patches can be applied in any order.


--- games/hack/hack.timeout.c.orig      Sat Jan  9 18:33:15 2016
+++ games/hack/hack.timeout.c   Sat Mar 10 23:11:05 2018
@@ -73,7 +73,7 @@
        if(Stoned) stoned_dialogue();
        for(upp = u.uprops; upp < u.uprops+SIZE(u.uprops); upp++)
            if((upp->p_flgs & TIMEOUT) && !--upp->p_flgs) {
-               if(upp->p_tofn) (*upp->p_tofn)();
+               if(upp->p_tofn) float_down();
                else switch(upp - u.uprops){
                case STONED:
                        killer = "cockatrice";

Reply via email to