From bcf1bd5c9e87df127f1647867574737e6e1674b0 Mon Sep 17 00:00:00 2001 From: FujiZ Date: Tue, 26 Nov 2019 04:52:42 +0800 Subject: [PATCH] read vtable size through ReadScalar() (#5636) --- include/flatbuffers/flatbuffers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 5c846a6d9..94f78d9b4 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(it); auto vt2 = reinterpret_cast(buf_.data_at(*vt_offset_ptr)); - auto vt2_size = *vt2; + auto vt2_size = ReadScalar(vt2); if (vt1_size != vt2_size || 0 != memcmp(vt2, vt1, vt1_size)) continue; vt_use = *vt_offset_ptr; buf_.pop(GetSize() - vtableoffsetloc);