mirror of
https://github.com/vee1e/flatbuffers.git
synced 2026-09-01 09:51:12 +00:00
add verification that type_vec.size == vec.size() (#8853)
Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
This commit is contained in:
parent
68e3c839c3
commit
b1e7868db6
1 changed files with 1 additions and 0 deletions
|
|
@ -156,6 +156,7 @@ static bool VerifyVector(flatbuffers::Verifier& v,
|
||||||
auto type_vec = table.GetPointer<Vector<uint8_t>*>(vec_field.offset() -
|
auto type_vec = table.GetPointer<Vector<uint8_t>*>(vec_field.offset() -
|
||||||
sizeof(voffset_t));
|
sizeof(voffset_t));
|
||||||
if (!v.VerifyVector(type_vec)) return false;
|
if (!v.VerifyVector(type_vec)) return false;
|
||||||
|
if (type_vec->size() != vec->size()) return false;
|
||||||
for (uoffset_t j = 0; j < vec->size(); j++) {
|
for (uoffset_t j = 0; j < vec->size(); j++) {
|
||||||
// get union type from the prev field
|
// get union type from the prev field
|
||||||
auto utype = type_vec->Get(j);
|
auto utype = type_vec->Get(j);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue