mirror of
https://github.com/vee1e/flatbuffers.git
synced 2026-09-01 09:51:12 +00:00
fix: infinite loop in proto reserved range parser (CWE-835) (#8966)
This commit is contained in:
parent
e35817577c
commit
fc9909c30a
1 changed files with 4 additions and 2 deletions
|
|
@ -3172,8 +3172,10 @@ CheckedError Parser::ParseProtoFields(StructDef* struct_def, bool isextend,
|
||||||
return Error("Protobuf has non positive number in reserved ids");
|
return Error("Protobuf has non positive number in reserved ids");
|
||||||
|
|
||||||
if (range) {
|
if (range) {
|
||||||
for (voffset_t id = from + 1; id <= attribute; id++)
|
for (uint32_t id = static_cast<uint32_t>(from) + 1;
|
||||||
struct_def->reserved_ids.push_back(id);
|
id <= static_cast<uint32_t>(attribute); id++) {
|
||||||
|
struct_def->reserved_ids.push_back(static_cast<voffset_t>(id));
|
||||||
|
}
|
||||||
|
|
||||||
range = false;
|
range = false;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue