From 602721a7355a3193a6770450d4ed082b6ba0f70f Mon Sep 17 00:00:00 2001 From: stefan301 <32997632+stefan301@users.noreply.github.com> Date: Mon, 23 Dec 2019 18:08:35 +0100 Subject: [PATCH] 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 --- include/flatbuffers/flatbuffers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 9a4f7ccd7..7977dc9c5 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -2143,7 +2143,7 @@ class Verifier FLATBUFFERS_FINAL_CLASS { } template 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).