forked from BigfootDev/flatbuffers
Size verifier fix 2 (#8740)
* Fixes to make SizeVerifier work. In particular change all the places in the Flatbuffers library and generated code that were using `Verifier` to instead use `VerifierTemplate<TrackBufferSize>` and wrap them all inside `template <bool TrackBufferSize = false>`. Also add unit tests for SizeVerifier. * Format using `sh scripts/clang-format-git.sh` * Use `B` rather than `TrackBufferSize` for the name of the template parameter. * Update generated files.
This commit is contained in:
@@ -23,9 +23,10 @@
|
||||
namespace flexbuffers {
|
||||
|
||||
// Verifies the `nested` flexbuffer within a flatbuffer vector is valid.
|
||||
template <bool B>
|
||||
inline bool VerifyNestedFlexBuffer(
|
||||
const flatbuffers::Vector<uint8_t>* const nested,
|
||||
flatbuffers::Verifier& verifier) {
|
||||
flatbuffers::VerifierTemplate<B>& verifier) {
|
||||
if (!nested) return true;
|
||||
return verifier.Check(flexbuffers::VerifyBuffer(
|
||||
nested->data(), nested->size(), verifier.GetFlexReuseTracker()));
|
||||
|
||||
Reference in New Issue
Block a user