Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion include/flatbuffers/flexbuffers.h
Original file line number Diff line number Diff line change
Expand Up @@ -1983,8 +1983,12 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
#undef FLEX_CHECK_VERIFIED

bool VerifyTerminator(const String& s) {
// Range-check size + 1 bytes, then require the terminating byte to be NUL
// so NUL-scanning consumers of String::c_str() cannot read out of bounds
// (matches flatbuffers::Verifier::VerifyString).
return VerifyFromPointer(reinterpret_cast<const uint8_t*>(s.c_str()),
s.size() + 1);
s.size() + 1) &&
s.c_str()[s.size()] == '\0';
}

bool VerifyRef(Reference r) {
Expand Down
Loading