From b1e7868db68aba89b2879c7e42b449fb80e2e0a9 Mon Sep 17 00:00:00 2001 From: Justin Davis Date: Sun, 21 Dec 2025 16:55:54 -0500 Subject: [PATCH] add verification that type_vec.size == vec.size() (#8853) Co-authored-by: Wouter van Oortmerssen --- src/reflection.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/reflection.cpp b/src/reflection.cpp index 4b2f66daa..51e07eaa2 100644 --- a/src/reflection.cpp +++ b/src/reflection.cpp @@ -156,6 +156,7 @@ static bool VerifyVector(flatbuffers::Verifier& v, auto type_vec = table.GetPointer*>(vec_field.offset() - sizeof(voffset_t)); if (!v.VerifyVector(type_vec)) return false; + if (type_vec->size() != vec->size()) return false; for (uoffset_t j = 0; j < vec->size(); j++) { // get union type from the prev field auto utype = type_vec->Get(j);