From f614b9e27e9b953fe715825ef88bce93b36e56c7 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 21 May 2018 18:31:45 -0400 Subject: [PATCH] fix access violation in status_finish() if window port not initialized --- doc/fixes36.2 | 3 +++ src/botl.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 2cdd77fdc..705de5ca3 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -21,6 +21,9 @@ targetting with a polearm could give away location of hidden monster static prototype could be left orphaned depending on #defines in rip.c config file error handling routines were calling xx_wait_synch early even before the window system was initialized; add a default routine +status_finish() in botl.c would unconditionally invoke the window port's + win_status_finish() routine which was problematic if the windowport + wasn't initialized yet Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/botl.c b/src/botl.c index c219d3db3..8576d39e2 100644 --- a/src/botl.c +++ b/src/botl.c @@ -876,7 +876,8 @@ status_finish() int i; /* call the window port cleanup routine first */ - (*windowprocs.win_status_finish)(); + if (windowprocs.win_status_finish) + (*windowprocs.win_status_finish)(); /* free memory that we alloc'd now */ for (i = 0; i < MAXBLSTATS; ++i) {