diff options
author | Wouter van Oortmerssen <aardappel@gmail.com> | 2021-11-22 17:07:49 -0800 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2021-11-29 15:05:59 -0800 |
commit | 0fadaf391d55aac675e6cff122c83bf52eeabc2a (patch) | |
tree | bec88d37860bb112eeca61bcde3f9a52f6c40671 /include | |
parent | 4d0e9a870610fb3d50d03b110dcd18388ed30bdd (diff) | |
download | flatbuffers-0fadaf391d55aac675e6cff122c83bf52eeabc2a.tar.gz flatbuffers-0fadaf391d55aac675e6cff122c83bf52eeabc2a.tar.bz2 flatbuffers-0fadaf391d55aac675e6cff122c83bf52eeabc2a.zip |
Enable verifier on nested_flatbuffers
Diffstat (limited to 'include')
-rw-r--r-- | include/flatbuffers/verifier.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/flatbuffers/verifier.h b/include/flatbuffers/verifier.h index 8d99dc64..b6971c1d 100644 --- a/include/flatbuffers/verifier.h +++ b/include/flatbuffers/verifier.h @@ -183,6 +183,14 @@ class Verifier FLATBUFFERS_FINAL_CLASS { // clang-format on } + template<typename T> + bool VerifyNestedFlatBuffer(const Vector<uint8_t> *buf, + const char *identifier) { + if (!buf) return true; + Verifier nested_verifier(buf->data(), buf->size()); + return nested_verifier.VerifyBuffer<T>(identifier); + } + // Verify this whole buffer, starting with root type T. template<typename T> bool VerifyBuffer() { return VerifyBuffer<T>(nullptr); } |