Handle root offset and root table vtable invalidation (#7177)

* Handle invalid root offset

* Handle vtable offset invalidation

* Added script generator. Add more cases through vtable ref table size

* review responses

* vtable offset validation

* Moved padding insertion to the end. Tests invalid field lenghts

* table offsets validated. Added type after field

* validate string length

* add todo

* invalid vector length

* invalid structs

* general cleanup

* reworded invalid offsets

* example for vector of structs

* invalid vector of tables

* invalid vector of strings

* invalid vector of scalars

* vector of unions

* validate union type value

* invalid vector union type values
This commit is contained in:
Derek Bailey
2022-03-23 21:51:32 -07:00
committed by GitHub
parent 2ad408697f
commit e2be0c0b06
52 changed files with 4712 additions and 337 deletions

View File

@@ -350,8 +350,8 @@ void FlatCompiler::AnnotateBinaries(
reinterpret_cast<const uint8_t *>(binary_contents.c_str());
const size_t binary_size = binary_contents.size();
flatbuffers::BinaryAnnotator binary_annotator(binary_schema,
binary_schema_size, binary);
flatbuffers::BinaryAnnotator binary_annotator(
binary_schema, binary_schema_size, binary, binary_size);
auto annotations = binary_annotator.Annotate();