Merge pull request #89274 from 0x0ACB/unchecked_cast

Fix use after free in `GDScriptLanguage::debug_get_globals`
This commit is contained in:
Rémi Verschelde 2024-07-26 13:43:48 +02:00
commit 2a61a2fa2f
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -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;
}