]> granicus.if.org Git - nethack/commitdiff
Check the return value of nhl_init() on com_pager_core()
authorSHIRAKATA Kentaro <argrath@ub32.org>
Wed, 9 Feb 2022 20:24:34 +0000 (05:24 +0900)
committerPatR <rankin@nethack.org>
Sat, 12 Feb 2022 15:45:46 +0000 (07:45 -0800)
nhl_init() can return NULL.

src/questpgr.c

index d04f7768ac447e75408dfb30bc3c88376288c684..11c5405999deb87b4e973b9f414a5a4ac1735d13 100644 (file)
@@ -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)