Skip to content

Commit

Permalink
Protect against null shopkeeper in shk_other_services. The fuzzer fou…
Browse files Browse the repository at this point in the history
…nd a shopkeeper that didn't have the shopkeeper struct for some reason when #chat was used.
  • Loading branch information
elunna committed Oct 13, 2023
1 parent 340d033 commit cd655ea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/shk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit cd655ea

Please sign in to comment.