From ae452e04b9dd6712050e99d47c071c86b60a0b9d Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 16 Jan 2026 21:17:15 +0200 Subject: [PATCH] Don't discover generic objects Potion of object detection and then looking at a generic object glyph on the map would try to "discover" the generic object, and the loop in discover_object would go too far, overwriting the exclusion_zones pointer. Take the easy route and just prevent discovery of generic objects; there are probably other places where the generic objects should be handled too, but the fuzzer hasn't hit them. --- src/o_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/o_init.c b/src/o_init.c index d53ee1ecd..8b81da282 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -451,6 +451,9 @@ discover_object( boolean mark_as_encountered, boolean credit_hero) { + if (oindx < FIRST_OBJECT) /* don't discover generic objects */ + return; + if ((!objects[oindx].oc_name_known && mark_as_known) || (!objects[oindx].oc_encountered && mark_as_encountered) || (Role_if(PM_SAMURAI)