diff --git a/src/reflection.cpp b/src/reflection.cpp index 268d7d8515..3bb17ccbbb 100644 --- a/src/reflection.cpp +++ b/src/reflection.cpp @@ -155,6 +155,7 @@ static bool VerifyVector(flatbuffers::Verifier& v, if (!vec) return true; auto type_vec = table.GetPointer*>(vec_field.offset() - sizeof(voffset_t)); + if (!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++) { @@ -800,4 +801,4 @@ bool VerifySizePrefixed(const reflection::Schema& schema, /*required=*/true); } -} // namespace flatbuffers +} // namespace flatbuffers \ No newline at end of file