]> granicus.if.org Git - nethack/commitdiff
saving msg history glitch (trunk only)
authornethack.allison <nethack.allison>
Mon, 27 Oct 2003 00:23:22 +0000 (00:23 +0000)
committernethack.allison <nethack.allison>
Mon, 27 Oct 2003 00:23:22 +0000 (00:23 +0000)
<Someone> discovered that it is possible to
have wins[WIN_MESSAGE] be null during
a hangup, not sure why yet.

Put a guard in to prevent de-referencing a null pointer.

win/tty/topl.c

index a37043c52a795338be8f70530cfd67f87b71b4ad..c1f4f06c4036f4bcabed6f50d3e07f42c5a716bd 100644 (file)
@@ -469,6 +469,7 @@ boolean init;
        register struct WinDesc *cw = wins[WIN_MESSAGE];
        char *retstr = (char *)0;
 
+       if (!cw) return (char *)0;      /* bail */
        /*
         * state 0 = normal return with string from msg history.
         * state 1 = finished with recall data, return toplines.