summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWouter van Oortmerssen <aardappel@gmail.com>2021-11-22 17:07:49 -0800
committerWouter van Oortmerssen <aardappel@gmail.com>2021-11-29 15:05:59 -0800
commit0fadaf391d55aac675e6cff122c83bf52eeabc2a (patch)
treebec88d37860bb112eeca61bcde3f9a52f6c40671 /include
parent4d0e9a870610fb3d50d03b110dcd18388ed30bdd (diff)
downloadflatbuffers-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.h8
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); }