mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 20:31:23 +00:00
Fixed Parser not checking size of union types vector
Change-Id: Ibcfc49a9c9376372bd15da2ed3a7f7a298863ccc
This commit is contained in:
@@ -1128,6 +1128,9 @@ CheckedError Parser::ParseAnyValue(Value &val, FieldDef *field,
|
||||
}
|
||||
uint8_t enum_idx;
|
||||
if (vector_of_union_types) {
|
||||
if (vector_of_union_types->size() <= count)
|
||||
return Error("union types vector smaller than union values vector"
|
||||
" for: " + field->name);
|
||||
enum_idx = vector_of_union_types->Get(count);
|
||||
} else {
|
||||
ECHECK(atot(constant.c_str(), *this, &enum_idx));
|
||||
|
||||
Reference in New Issue
Block a user