mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-02 05:38:18 +00:00
Vector of structs were not being verified correctly.
Because they are represented as `const T *` in the Vector template, the sizeof(const T *) was accidentally used instead of sizeof(T). Change-Id: Ib4dc73e1d21396ba2e30c84e5e229c4147204bb1 Tested: on Linux.
This commit is contained in:
@@ -919,6 +919,11 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
|
|||||||
&end);
|
&end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Verify a pointer (may be NULL) of a vector to struct.
|
||||||
|
template<typename T> bool Verify(const Vector<const T *> *vec) const {
|
||||||
|
return Verify(reinterpret_cast<const Vector<T> *>(vec));
|
||||||
|
}
|
||||||
|
|
||||||
// Verify a pointer (may be NULL) to string.
|
// Verify a pointer (may be NULL) to string.
|
||||||
bool Verify(const String *str) const {
|
bool Verify(const String *str) const {
|
||||||
const uint8_t *end;
|
const uint8_t *end;
|
||||||
|
|||||||
Reference in New Issue
Block a user