diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-06-15 23:52:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-15 23:52:48 +0200 |
commit | cfacc400a37f2c23b520d4d1b4181a0d4889b26a (patch) | |
tree | 26c81cd1ad915ac95f650262d5e3fcebd535c0ad /core/variant | |
parent | 2f9b7b7a605f20321c1a239935152723bc13edf0 (diff) | |
parent | fb8643077045c5f9171a647edc8e4233ab6c20fb (diff) |
Merge pull request #62077 from RandomShaper/fix_append_array
Validate every source element separately `Array::append_array()`
Diffstat (limited to 'core/variant')
-rw-r--r-- | core/variant/array.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/variant/array.cpp b/core/variant/array.cpp index b1e142d239..599c3e1dfe 100644 --- a/core/variant/array.cpp +++ b/core/variant/array.cpp @@ -260,7 +260,9 @@ void Array::push_back(const Variant &p_value) { void Array::append_array(const Array &p_array) { ERR_FAIL_COND_MSG(_p->read_only, "Array is in read-only state."); - ERR_FAIL_COND(!_p->typed.validate(p_array, "append_array")); + for (int i = 0; i < p_array.size(); ++i) { + ERR_FAIL_COND(!_p->typed.validate(p_array[i], "append_array")); + } _p->array.append_array(p_array._p->array); } |