From: Wouter van Oortmerssen Date: Thu, 19 May 2016 01:00:25 +0000 (-0700) Subject: Fixes verifier not catching odd vtable sizes. X-Git-Tag: v1.4.0~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=69eef0a0ece27a2f07397e763b5bac389a98c4d8;p=platform%2Fupstream%2Fflatbuffers.git Fixes verifier not catching odd vtable sizes. Bug: 28762769 Change-Id: Iec370482f67c4585e97dd5175c1a4258ddba47fe Tested: on Linux. --- diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index c78583c..0fa3125 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -1383,6 +1383,7 @@ class Table { // Check the vtable size field, then check vtable fits in its entirety. return verifier.VerifyComplexity() && verifier.Verify(vtable) && + (ReadScalar(vtable) & (sizeof(voffset_t) - 1)) == 0 && verifier.Verify(vtable, ReadScalar(vtable)); }