ORC-2196: [C++] Validate type tree when creating reader from serialized file tail - #2679
Closed
dongjoon-hyun wants to merge 1 commit into
Closed
ORC-2196: [C++] Validate type tree when creating reader from serialized file tail#2679dongjoon-hyun wants to merge 1 commit into
dongjoon-hyun wants to merge 1 commit into
Conversation
dongjoon-hyun
added a commit
that referenced
this pull request
Jul 8, 2026
…ed file tail ### What changes were proposed in this pull request? This PR aims to validate the ORC type tree in `createReader` when the footer comes from a serialized file tail (`ReaderOptions.setSerializedFileTail`), by calling the existing `checkProtoTypes` in the same way as the file-read path. ### Why are the changes needed? The serialized-file-tail branch of `createReader` builds `contents->footer` directly from the parsed `proto::FileTail` without validation. A malformed footer with an out-of-range or back-referencing subtype flows into `convertType`, causing an out-of-bounds read or unbounded recursion (stack overflow) in release builds. The file-read path already validates via `checkProtoTypes`, and the Java reader validates both tail paths (`OrcTail` and `ReaderImpl`). This closes the remaining C++ parity gap. ### How was this patch tested? Pass the CIs with a newly added test case. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Fable 5 Closes #2679 from dongjoon-hyun/ORC-2196. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 11f07f6) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
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.
What changes were proposed in this pull request?
This PR aims to validate the ORC type tree in
createReaderwhen the footer comes from a serialized file tail (ReaderOptions.setSerializedFileTail), by calling the existingcheckProtoTypesin the same way as the file-read path.Why are the changes needed?
The serialized-file-tail branch of
createReaderbuildscontents->footerdirectly from the parsedproto::FileTailwithout validation. A malformed footer with an out-of-range or back-referencing subtype flows intoconvertType, causing an out-of-bounds read or unbounded recursion (stack overflow) in release builds.The file-read path already validates via
checkProtoTypes, and the Java reader validates both tail paths (OrcTailandReaderImpl). This closes the remaining C++ parity gap.How was this patch tested?
Pass the CIs with a newly added test case.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Fable 5