summaryrefslogtreecommitdiffstats
path: root/scene/debugger
diff options
context:
space:
mode:
authorkleonc <9283098+kleonc@users.noreply.github.com>2023-07-19 13:11:08 +0200
committerkleonc <9283098+kleonc@users.noreply.github.com>2023-07-19 18:13:15 +0200
commit95809e58d5fd888fa3e5d86ffc071bb4b18ddbb4 (patch)
tree877c9ee920e98e8f59f3d50ec8466aa7a1df4f4e /scene/debugger
parent0c2144da908a8223e188d27ed1d31d8248056c78 (diff)
downloadredot-engine-95809e58d5fd888fa3e5d86ffc071bb4b18ddbb4.tar.gz
Fix arg count checks in SceneDebugger
Diffstat (limited to 'scene/debugger')
-rw-r--r--scene/debugger/scene_debugger.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/debugger/scene_debugger.cpp b/scene/debugger/scene_debugger.cpp
index 391388fc04..4b097412d6 100644
--- a/scene/debugger/scene_debugger.cpp
+++ b/scene/debugger/scene_debugger.cpp
@@ -163,6 +163,7 @@ Error SceneDebugger::parse_message(void *p_user, const String &p_msg, const Arra
live_editor->_res_set_func(p_args[0], p_args[1], p_args[2]);
} else if (p_msg == "live_node_call") {
+ ERR_FAIL_COND_V(p_args.size() < 2, ERR_INVALID_DATA);
LocalVector<Variant> args;
LocalVector<Variant *> argptrs;
args.resize(p_args.size() - 2);
@@ -171,11 +172,10 @@ Error SceneDebugger::parse_message(void *p_user, const String &p_msg, const Arra
args[i] = p_args[i + 2];
argptrs[i] = &args[i];
}
- live_editor->_node_call_func(p_args[0], p_args[1], (const Variant **)argptrs.ptr(), argptrs.size());
+ live_editor->_node_call_func(p_args[0], p_args[1], argptrs.size() ? (const Variant **)argptrs.ptr() : nullptr, argptrs.size());
} else if (p_msg == "live_res_call") {
- ERR_FAIL_COND_V(p_args.size() < 10, ERR_INVALID_DATA);
-
+ ERR_FAIL_COND_V(p_args.size() < 2, ERR_INVALID_DATA);
LocalVector<Variant> args;
LocalVector<Variant *> argptrs;
args.resize(p_args.size() - 2);
@@ -184,7 +184,7 @@ Error SceneDebugger::parse_message(void *p_user, const String &p_msg, const Arra
args[i] = p_args[i + 2];
argptrs[i] = &args[i];
}
- live_editor->_res_call_func(p_args[0], p_args[1], (const Variant **)argptrs.ptr(), argptrs.size());
+ live_editor->_res_call_func(p_args[0], p_args[1], argptrs.size() ? (const Variant **)argptrs.ptr() : nullptr, argptrs.size());
} else if (p_msg == "live_create_node") {
ERR_FAIL_COND_V(p_args.size() < 3, ERR_INVALID_DATA);