Fixed ASan array out of bounds.

Change-Id: I53366bd14548aa41c3d25bcd187d7436d47e8665
Tested: on Linux.
parent b752e4a9
......@@ -944,7 +944,7 @@ CheckedError Parser::ParseTableDelimiters(size_t &fieldn,
if ((!opts.strict_json || !fieldn) && Is(terminator)) break;
std::string name;
if (is_nested_vector) {
if (fieldn > struct_def->fields.vec.size()) {
if (fieldn >= struct_def->fields.vec.size()) {
return Error("too many unnamed fields in nested array");
}
name = struct_def->fields.vec[fieldn]->name;
......
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