diff options
author | FujiZ <i@fujiz.me> | 2019-11-26 04:52:42 +0800 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2019-11-25 12:52:42 -0800 |
commit | bcf1bd5c9e87df127f1647867574737e6e1674b0 (patch) | |
tree | ed0c1e7fa24c3f2216987759cb5027ce668b7746 | |
parent | 136d75fa6580ef87d1b7cbc243e617f21149852e (diff) | |
download | flatbuffers-bcf1bd5c9e87df127f1647867574737e6e1674b0.tar.gz flatbuffers-bcf1bd5c9e87df127f1647867574737e6e1674b0.tar.bz2 flatbuffers-bcf1bd5c9e87df127f1647867574737e6e1674b0.zip |
read vtable size through ReadScalar() (#5636)
-rw-r--r-- | include/flatbuffers/flatbuffers.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 5c846a6d..94f78d9b 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -1364,7 +1364,7 @@ class FlatBufferBuilder { it += sizeof(uoffset_t)) { auto vt_offset_ptr = reinterpret_cast<uoffset_t *>(it); auto vt2 = reinterpret_cast<voffset_t *>(buf_.data_at(*vt_offset_ptr)); - auto vt2_size = *vt2; + auto vt2_size = ReadScalar<voffset_t>(vt2); if (vt1_size != vt2_size || 0 != memcmp(vt2, vt1, vt1_size)) continue; vt_use = *vt_offset_ptr; buf_.pop(GetSize() - vtableoffsetloc); |