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:
Fergus Henderson
2025-11-24 12:11:32 +00:00
committed by GitHub
parent 7ea8db05d8
commit 20548ff3b6
30 changed files with 588 additions and 305 deletions

View File

@@ -11,5 +11,7 @@
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
flatbuffers::Verifier verifier(data, size);
MyGame::Example::VerifyMonsterBuffer(verifier);
flatbuffers::SizeVerifier size_verifier(data, size);
MyGame::Example::VerifyMonsterBuffer(size_verifier);
return 0;
}