From: SHIRAKATA Kentaro Date: Wed, 9 Feb 2022 20:24:34 +0000 (+0900) Subject: Check the return value of nhl_init() on com_pager_core() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb5150445a1259c5e3a8e510aac635e8c6a6433e;p=nethack Check the return value of nhl_init() on com_pager_core() nhl_init() can return NULL. --- diff --git a/src/questpgr.c b/src/questpgr.c index d04f7768a..11c540599 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -438,6 +438,11 @@ com_pager_core(const char *section, const char *msgid, boolean showerror) return FALSE; L = nhl_init(); + if (!L) { + if (showerror) + impossible("com_pager: nhl_init() failed"); + goto compagerdone; + } if (!nhl_loadlua(L, QTEXT_FILE)) { if (showerror)