projects
/
platform
/
upstream
/
flatbuffers.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d5add9f
)
Fixed Parser not checking size of union types vector
author
Wouter van Oortmerssen
<aardappel@gmail.com>
Mon, 14 Feb 2022 19:48:46 +0000
(11:48 -0800)
committer
Wouter van Oortmerssen
<aardappel@gmail.com>
Mon, 14 Feb 2022 19:48:46 +0000
(11:48 -0800)
Change-Id: Ibcfc49a9c9376372bd15da2ed3a7f7a298863ccc
src/idl_parser.cpp
patch
|
blob
|
history
diff --git
a/src/idl_parser.cpp
b/src/idl_parser.cpp
index
7e4cb08
..
47d01f0
100644
(file)
--- a/
src/idl_parser.cpp
+++ b/
src/idl_parser.cpp
@@
-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));