diff --git a/include/flatbuffers/reflection.h b/include/flatbuffers/reflection.h index 052e6d927..f606b7b5e 100644 --- a/include/flatbuffers/reflection.h +++ b/include/flatbuffers/reflection.h @@ -470,7 +470,9 @@ Offset CopyTable(FlatBufferBuilder &fbb, // buf should point to the start of flatbuffer data. // length specifies the size of the flatbuffer data. bool Verify(const reflection::Schema &schema, const reflection::Object &root, - const uint8_t *buf, size_t length); + const uint8_t *buf, size_t length, + uoffset_t max_depth = 64, + uoffset_t max_tables = 1000000); } // namespace flatbuffers diff --git a/src/reflection.cpp b/src/reflection.cpp index 77ea0dcf4..abe9bb5d0 100644 --- a/src/reflection.cpp +++ b/src/reflection.cpp @@ -705,8 +705,10 @@ bool VerifyObject(flatbuffers::Verifier &v, const reflection::Schema &schema, } bool Verify(const reflection::Schema &schema, const reflection::Object &root, - const uint8_t *buf, size_t length) { - Verifier v(buf, length); + const uint8_t *buf, size_t length, + uoffset_t max_depth /*= 64*/, + uoffset_t max_tables /*= 1000000*/) { + Verifier v(buf, length, max_depth, max_tables); return VerifyObject(v, schema, root, flatbuffers::GetAnyRoot(buf), true); }