From 38529ae8fa5f85ae0ba9acce11127777bbae12ac Mon Sep 17 00:00:00 2001 From: apple1417 Date: Fri, 15 Dec 2023 21:50:29 +1300 Subject: [PATCH] also check weak object index upper bound --- src/unrealsdk/unreal/wrappers/gobjects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unrealsdk/unreal/wrappers/gobjects.cpp b/src/unrealsdk/unreal/wrappers/gobjects.cpp index 040980b..5f9cccd 100644 --- a/src/unrealsdk/unreal/wrappers/gobjects.cpp +++ b/src/unrealsdk/unreal/wrappers/gobjects.cpp @@ -83,7 +83,7 @@ UObject* GObjects::get_weak_object(const FWeakObjectPtr* ptr) const { if (ptr->object_serial_number == 0) { return nullptr; } - if (ptr->object_index < 0) { + if (0 > ptr->object_index || ptr->object_index >= this->internal->ObjObjects.Count) { return nullptr; }