mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-04 04:33:23 +00:00
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:
@@ -4352,8 +4352,9 @@ bool Parser::Deserialize(const uint8_t* buf, const size_t size) {
|
||||
else
|
||||
size_prefixed = true;
|
||||
}
|
||||
auto verify_fn = size_prefixed ? &reflection::VerifySizePrefixedSchemaBuffer
|
||||
: &reflection::VerifySchemaBuffer;
|
||||
auto verify_fn = size_prefixed
|
||||
? &reflection::VerifySizePrefixedSchemaBuffer<false>
|
||||
: &reflection::VerifySchemaBuffer<false>;
|
||||
if (!verify_fn(verifier)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user