ffacs opened a new pull request, #2621:
URL: https://github.com/apache/orc/pull/2621
### 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:
```bash
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.
--
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]