Skip to content

Commit 2880299

Browse files
Update src/iceberg/avro/avro_schema_util.cc
Co-authored-by: Gang Wu <[email protected]>
1 parent 73e057a commit 2880299

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/iceberg/avro/avro_schema_util.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,9 @@ Result<::avro::NodePtr> CreateRecordNodeWithFieldIds(const ::avro::NodePtr& orig
802802
return InvalidSchema(...);
803803
}
804804
const std::string& field_name = original_node->nameAt(i);
805+
if (i >= original_node->leaves()) {
806+
return InvalidSchema(...);
807+
}
805808
::avro::NodePtr field_node = original_node->leafAt(i);
806809

807810
// TODO(liuxiaoyu): Add support for case sensitivity in name matching.

0 commit comments

Comments
 (0)