Skip to content

Commit

Permalink
Fix index check
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka committed Jan 24, 2019
1 parent f0a8ca0 commit 439e81f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/field_instance.h
Expand Up @@ -146,7 +146,7 @@ class ConstFieldInstance {
: reflection().GetEnum(*message_, descriptor_);
*value = {static_cast<size_t>(value_descriptor->index()),
static_cast<size_t>(value_descriptor->type()->value_count())};
if (value->index < 0 || value->index > value->count) GetDefault(value);
if (value->index < 0 || value->index >= value->count) GetDefault(value);
}

void Load(std::string* value) const {
Expand Down

0 comments on commit 439e81f

Please sign in to comment.