diff options
author | kleonc <9283098+kleonc@users.noreply.github.com> | 2023-07-19 13:11:08 +0200 |
---|---|---|
committer | kleonc <9283098+kleonc@users.noreply.github.com> | 2023-07-19 18:13:15 +0200 |
commit | 95809e58d5fd888fa3e5d86ffc071bb4b18ddbb4 (patch) | |
tree | 877c9ee920e98e8f59f3d50ec8466aa7a1df4f4e /scene/debugger | |
parent | 0c2144da908a8223e188d27ed1d31d8248056c78 (diff) | |
download | redot-engine-95809e58d5fd888fa3e5d86ffc071bb4b18ddbb4.tar.gz |
Fix arg count checks in SceneDebugger
Diffstat (limited to 'scene/debugger')
-rw-r--r-- | scene/debugger/scene_debugger.cpp | 8 |
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); |