Fixed a verifier check that didn't return from its parent.

Change-Id: I1aef5fdba72de0c3bb8276c9f50fffa494f26e29
Tested: on Linux.
parent f6330ab8
...@@ -1222,7 +1222,8 @@ class Verifier FLATBUFFERS_FINAL_CLASS { ...@@ -1222,7 +1222,8 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
// must be 0. // must be 0.
auto size = ReadScalar<uoffset_t>(vec); auto size = ReadScalar<uoffset_t>(vec);
auto max_elems = FLATBUFFERS_MAX_BUFFER_SIZE / elem_size; auto max_elems = FLATBUFFERS_MAX_BUFFER_SIZE / elem_size;
Check(size < max_elems); // Protect against byte_size overflowing. if (!Check(size < max_elems))
return false; // Protect against byte_size overflowing.
auto byte_size = sizeof(size) + elem_size * size; auto byte_size = sizeof(size) + elem_size * size;
*end = vec + byte_size; *end = vec + byte_size;
return Verify(vec, byte_size); return Verify(vec, byte_size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment