From dbb1d0f230aeb9777a8f782cb2eb25eec60ae9e5 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Mon, 27 Oct 2003 00:23:22 +0000 Subject: [PATCH] saving msg history glitch (trunk only) 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/win/tty/topl.c b/win/tty/topl.c index a37043c52..c1f4f06c4 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -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. -- 2.50.1