mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 12:05:50 +00:00
[C++] Add max_depth and max_tables parameters to reflection::Verify (#5815)
* Added missing EndTable() call to VerifyObject() VerifyObject called VerifyTableStart() but not EndTable(). This made Verifier::VerifyComplexity() increase depth_ with each table, not with the depth of tables. https://groups.google.com/forum/#!topic/flatbuffers/OpxtW5UFAdg * Added Check to VerifyAlignment https://stackoverflow.com/questions/59376308/flatbuffers-verifier-returns-false-without-any-assertion-flatbuffers-debug-veri * [C++] Add max_depth and max_tables parameters to reflection::Verify Co-authored-by: Felkel <stefan@eas.local> Co-authored-by: stefan301 <Stefan.Felkel@de.Zuken.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user