projects
/
platform
/
upstream
/
flatbuffers.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7cce55d
)
Fixes verifier not catching odd vtable sizes.
author
Wouter van Oortmerssen
<wvo@google.com>
Thu, 19 May 2016 01:00:25 +0000
(18:00 -0700)
committer
Wouter van Oortmerssen
<wvo@google.com>
Thu, 19 May 2016 01:00:25 +0000
(18:00 -0700)
Bug:
28762769
Change-Id: Iec370482f67c4585e97dd5175c1a4258ddba47fe
Tested: on Linux.
include/flatbuffers/flatbuffers.h
patch
|
blob
|
history
diff --git
a/include/flatbuffers/flatbuffers.h
b/include/flatbuffers/flatbuffers.h
index
c78583c
..
0fa3125
100644
(file)
--- 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<voffset_t>(vtable) &&
+ (ReadScalar<voffset_t>(vtable) & (sizeof(voffset_t) - 1)) == 0 &&
verifier.Verify(vtable, ReadScalar<voffset_t>(vtable));
}