Repository navigation
Conversation
nanoarrow FULL validation only requires a struct's children to be at least as long as the parent, but ParseManifestList/ParseDataFile/ ParseManifestEntry index containers sized by the parent's row count using each child's own length. A spec-legal batch with a longer child would drive those parsers past the end of the output vector. Add AssertChildrenLength and call it everywhere a struct's children feed a parent-sized container, including the partition struct case which previously skipped the children-count check entirely.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ParseManifestList,ParseDataFile, andParseManifestEntryindex containers that are pre-sized to the parent's row count using each child's ownlength. A spec-legal batch with a longer child drives those loops past the end of the output vector.AssertChildrenLength, which asserts every child of a struct view has exactly the same length as the parent, and call it everywhere a struct's children feed a parent-sized container.kPartitionFieldIdcase inParseDataFilepreviously validated the partition struct's type with a bareAssertViewType(no children-count check at all); it now usesAssertViewTypeAndChildrenplus the new length check, matching the other call sites.Test plan
AssertChildrenLengthTest.RejectsChildLongerThanParentinmanifest_reader_test.cc, hand-building an ArrowStructArraywhose declared length is shorter than its child's actual length (legal under nanoarrow FULL validation) and assertingInvalidArgument.AssertChildrenLengthto a no-op) and passes with it restored.manifest_testsuite: 227 passed, 0 failed.