Commit 602721a7 authored by stefan301's avatar stefan301 Committed by Wouter van Oortmerssen

Added Check to VerifyAlignment (#5675)

* Added missing EndTable() call to VerifyObject()

VerifyObject called VerifyTableStart() but not EndTable(). This made Verifier::VerifyComplexity() increase depth_ with each table, not with the depth of tables.

https://groups.google.com/forum/#!topic/flatbuffers/OpxtW5UFAdg

* Added Check to VerifyAlignment

https://stackoverflow.com/questions/59376308/flatbuffers-verifier-returns-false-without-any-assertion-flatbuffers-debug-veri
parent 13c05f4d
...@@ -2143,7 +2143,7 @@ class Verifier FLATBUFFERS_FINAL_CLASS { ...@@ -2143,7 +2143,7 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
} }
template<typename T> bool VerifyAlignment(size_t elem) const { template<typename T> bool VerifyAlignment(size_t elem) const {
return (elem & (sizeof(T) - 1)) == 0 || !check_alignment_; return Check((elem & (sizeof(T) - 1)) == 0 || !check_alignment_);
} }
// Verify a range indicated by sizeof(T). // Verify a range indicated by sizeof(T).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment