GH-49626: [C++][Parquet] Fix encoding fuzzing failure#49627
Open
pitrou wants to merge 1 commit intoapache:mainfrom
Open
GH-49626: [C++][Parquet] Fix encoding fuzzing failure#49627pitrou wants to merge 1 commit intoapache:mainfrom
pitrou wants to merge 1 commit intoapache:mainfrom
Conversation
The DecodeArrow decoder functions are expected to always return the number of requested values or error out, but the DELTA_BINARY_PACKED would not always satisfy this guarantee.
Member
Author
|
@github-actions crossbow submit fuzz |
|
Revision: 307a685 Submitted crossbow builds: ursacomputing/crossbow @ actions-4dc12a1f5e
|
Member
Author
|
@wgtmac Would you like to review this? |
wgtmac
approved these changes
Apr 1, 2026
Member
wgtmac
left a comment
There was a problem hiding this comment.
Thanks for fixing this! I've left some minor comments.
| } | ||
| std::vector<T> values(num_values); | ||
| int decoded_count = GetInternal(values.data(), num_values); | ||
| if (decoded_count < num_values) { |
Member
There was a problem hiding this comment.
Do we need to add ARROW_PREDICT_FALSE?
Member
Author
There was a problem hiding this comment.
I don't think so, because 1) this is not in a critical loop and 2) compilers tend to assume that exception-raising paths are unlikely.
By the way, here's an interesting presentation on the topic: https://cppcon.digital-medium.co.uk/wp-content/uploads/2022/09/C20-likely-Attribute-Optimizations-Pessimizations-and-unlikely-Consequences.pdf
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.
Rationale for this change
The DecodeArrow decoder functions are expected to always return the number of requested values or error out, but the DELTA_BINARY_PACKED would not always satisfy this guarantee.
Issue found by OSS-Fuzz: https://issues.oss-fuzz.com/issues/492457225
What changes are included in this PR?
DecodeArrowfunctions for DELTA_BINARY_PACKED error out if there are not enough valuesDecodeArrowdocstrings to clarify the meaning of the parameters and return valueAre these changes tested?
Only by fuzz regression file.
Are there any user-facing changes?
No.