From cd655ea58ac5c7d60dda13ec431ed7271ad4349d Mon Sep 17 00:00:00 2001 From: Erik Lunna Date: Fri, 13 Oct 2023 15:11:33 +0200 Subject: [PATCH] Protect against null shopkeeper in shk_other_services. The fuzzer found a shopkeeper that didn't have the shopkeeper struct for some reason when #chat was used. --- src/shk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shk.c b/src/shk.c index 6b17f1d6e..f3ec0ae14 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1786,6 +1786,9 @@ shk_other_services() /* Init the shopkeeper */ shkp = shop_keeper(/* roomno= */*u.ushops); + if (!shkp) + return result; + shkdat = &mons[ERAC(shkp)->rmnum]; /* Init your name */