Skip to content

Commit be71cef

Browse files
Update src/iceberg/avro/avro_schema_util.cc
Co-authored-by: Gang Wu <ustcwg@gmail.com>
1 parent 472fe6e commit be71cef

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
@@ -792,6 +792,9 @@ Result<::avro::NodePtr> CreateRecordNodeWithFieldIds(const ::avro::NodePtr& orig
792792
return InvalidSchema(...);
793793
}
794794
const std::string& field_name = original_node->nameAt(i);
795+
if (i >= original_node->leaves()) {
796+
return InvalidSchema(...);
797+
}
795798
::avro::NodePtr field_node = original_node->leafAt(i);
796799

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

0 commit comments

Comments
 (0)