CASSANDRA-21150: Fix VerifyTest failure due to unhandled IndexOutOfBoundsException in LZ4Compressor#4604
Open
arvindKandpal-ksolves wants to merge 1 commit intoapache:trunkfrom
Conversation
The replacement of org.lz4 with at.yawk.lz4 (for CVE-2025-12183) changed behavior during decompression of corrupt data. The new safe implementation throws IndexOutOfBoundsException instead of LZ4Exception. This commit catches both exceptions to ensure corruption is correctly detected and wrapped as IOException.
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.
Fix VerifyTest failure due to unhandled IndexOutOfBoundsException in LZ4Compressor
The recent replacement of org.lz4 with at.yawk.lz4 (to address CVE-2025-12183) changed the behavior during decompression of corrupt data. The new safe implementation throws IndexOutOfBoundsException instead of LZ4Exception when reading past array limits. This caused
VerifyTest#testVerifyCorruptRowCorrectDigestto fail because the test expects an IOException (indicating corruption) but received an unhandled RuntimeException.This patch updates LZ4Compressor to catch IndexOutOfBoundsException alongside LZ4Exception and wrap it in an IOException, restoring the correct corruption detection behavior.
patch by Arvind Kandpal; reviewed by TBD for CASSANDRA-21150