gty404 commented on code in PR #1054:
URL: https://github.com/apache/iceberg-cpp/pull/1054#discussion_r4384896339


##########
src/iceberg/manifest/manifest_reader.cc:
##########
@@ -318,6 +323,7 @@ Result<std::vector<ManifestFile>> 
ParseManifestList(ArrowSchema* arrow_schema,
 
   ICEBERG_RETURN_UNEXPECTED(AssertViewTypeAndChildren(
       &view, ArrowType::NANOARROW_TYPE_STRUCT, schema.fields().size(), 
"manifest_list"));
+  ICEBERG_RETURN_UNEXPECTED(AssertChildrenLength(&view, "manifest_list"));

Review Comment:
   Checked this — I don't think it's a gap. nanoarrow's 
ArrowArrayViewValidate(FULL) already rejects a struct child shorter than its 
parent, recursively, for every STRUCT node including map_view and elem_view 
(array.c:1134-1145), so "shorter" is already caught. And for the "longer" case 
this PR fixes elsewhere: ParseIntMapField/ParsePartitionFieldSummaryList index 
key_view/value_view/contains_null etc. by an offset taken from the outer 
list/map's own offsets buffer, not by the child's own length, so a longer child 
can't drive those loops out of bounds the way it does in ParseField-style 
parsers.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to