mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 23:50:00 +00:00
Fixes verifier not catching odd vtable sizes.
Bug: 28762769 Change-Id: Iec370482f67c4585e97dd5175c1a4258ddba47fe Tested: on Linux.
This commit is contained in:
@@ -1383,6 +1383,7 @@ class Table {
|
|||||||
// Check the vtable size field, then check vtable fits in its entirety.
|
// Check the vtable size field, then check vtable fits in its entirety.
|
||||||
return verifier.VerifyComplexity() &&
|
return verifier.VerifyComplexity() &&
|
||||||
verifier.Verify<voffset_t>(vtable) &&
|
verifier.Verify<voffset_t>(vtable) &&
|
||||||
|
(ReadScalar<voffset_t>(vtable) & (sizeof(voffset_t) - 1)) == 0 &&
|
||||||
verifier.Verify(vtable, ReadScalar<voffset_t>(vtable));
|
verifier.Verify(vtable, ReadScalar<voffset_t>(vtable));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user