From 69eef0a0ece27a2f07397e763b5bac389a98c4d8 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Wed, 18 May 2016 18:00:25 -0700 Subject: [PATCH] Fixes verifier not catching odd vtable sizes. Bug: 28762769 Change-Id: Iec370482f67c4585e97dd5175c1a4258ddba47fe Tested: on Linux. --- include/flatbuffers/flatbuffers.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index c78583cad..0fa31250f 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)); }