Fixes verifier not catching odd vtable sizes.

Bug: 28762769
Change-Id: Iec370482f67c4585e97dd5175c1a4258ddba47fe
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen 2016-05-18 18:00:25 -07:00
parent 7cce55d8f0
commit 69eef0a0ec
1 changed files with 1 additions and 0 deletions

View File

@ -1383,6 +1383,7 @@ class Table {
// Check the vtable size field, then check vtable fits in its entirety.
return verifier.VerifyComplexity() &&
verifier.Verify<voffset_t>(vtable) &&
(ReadScalar<voffset_t>(vtable) & (sizeof(voffset_t) - 1)) == 0 &&
verifier.Verify(vtable, ReadScalar<voffset_t>(vtable));
}