From 1264df9e7237760cc2d37939b3fc8f7c74726c0c Mon Sep 17 00:00:00 2001 From: Drew Lewis Date: Wed, 29 Apr 2026 15:27:29 +0000 Subject: [PATCH] Check is_object before accessing string offset in object_type --- util/Util.i | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/Util.i b/util/Util.i index cb08647a4..ae34555ce 100644 --- a/util/Util.i +++ b/util/Util.i @@ -252,7 +252,10 @@ is_object(const char *obj) const char * object_type(const char *obj) { - return &obj[1 + sizeof(void*) * 2 + 3]; + if (is_object(obj)) { + return &obj[1 + sizeof(void*) * 2 + 3]; + } + return ""; // Return empty string if not a valid object } ////////////////////////////////////////////////////////////////