ORC-2165: [C++] Fix bounds check for LZO stop command trailer#2621
Open
ffacs wants to merge 1 commit into
Open
ORC-2165: [C++] Fix bounds check for LZO stop command trailer#2621ffacs wants to merge 1 commit into
ffacs wants to merge 1 commit into
Conversation
wgtmac
approved these changes
May 12, 2026
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 fixes the C++ LZO decompressor stop command trailer validation. It now checks that two trailer bytes are available before reading them, and validates the trailer bytes
explicitly.
A regression test was added for truncated LZO stop command trailers.
Why are the changes needed?
Malformed LZO-compressed ORC input can end immediately after the LZO stop command, or with only one trailer byte remaining. The previous validation could read two bytes before safely
confirming that two bytes were available, causing an out-of-bounds read on truncated input.
The new check makes truncated LZO input fail cleanly with
ParseError.How was this patch tested?
Ran:
cmake --build build --target orc-test -j 8 build/c++/test/orc-test '--gtest_filter=TestDecompression.testLzo*'The LZO decompression tests passed.
Also ran a minimal AddressSanitizer harness against truncated LZO stop command inputs and confirmed there was no ASan report.
Was this patch authored or co-authored using generative AI tooling?
Yes. Generated with OpenAI Codex.