Add missing ERR_FAIL_INDEX check to Variant::construct
Other functions in the same file validate parameters using the ERR_FAIL macros. This validation was missing for Variant::construct resulting in a crash when called with invalid data (p_type < 0). fix #46067
This commit is contained in:
parent
4c10d31bc4
commit
6985967c3b
@ -773,6 +773,7 @@ void Variant::_unregister_variant_constructors() {
|
||||
}
|
||||
|
||||
void Variant::construct(Variant::Type p_type, Variant &base, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
|
||||
ERR_FAIL_INDEX(p_type, Variant::VARIANT_MAX);
|
||||
uint32_t s = construct_data[p_type].size();
|
||||
for (uint32_t i = 0; i < s; i++) {
|
||||
int argc = construct_data[p_type][i].argument_count;
|
||||
|
Loading…
Reference in New Issue
Block a user