summaryrefslogtreecommitdiffstats
path: root/modules/gdscript
diff options
context:
space:
mode:
authorACB <ansas.bogdan@rwth-aachen.de>2024-03-08 07:32:31 +0100
committerACB <ansas.bogdan@rwth-aachen.de>2024-03-08 07:32:31 +0100
commit7426b4d448102a312009b133497af55214e2b4c5 (patch)
tree3ed2b24170acedbe42d31d856d4563dd05aee197 /modules/gdscript
parentbb6b06c81343073f10cbbd2af515cf0dac1e6549 (diff)
downloadredot-engine-7426b4d448102a312009b133497af55214e2b4c5.tar.gz
Fix user after free in `GDScriptLanguage::debug_get_globals`
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gdscript_editor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index babd2c1772..3dcfc25f8a 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -402,7 +402,9 @@ void GDScriptLanguage::debug_get_globals(List<String> *p_globals, List<Variant>
}
const Variant &var = gl_array[E.value];
- if (Object *obj = var) {
+ bool freed = false;
+ const Object *obj = var.get_validated_object_with_check(freed);
+ if (obj && !freed) {
if (Object::cast_to<GDScriptNativeClass>(obj)) {
continue;
}