GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add test for corrupted LZ4 block input stream by Marcono1234 · Pull Request #7 · yawkat/lz4-java

Conversation

@Marcono1234

@Marcono1234 Marcono1234 commented Dec 2, 2025

Copy link
Copy Markdown

Follow-up for #3

Covers all the 3 IOException("Stream is corrupted", ...) exceptions thrown here (one of which was added in #3):

lz4-java/src/java/net/jpountz/lz4/LZ4BlockInputStream.java

Lines 291 to 305 in d2d01a7

try {
if (fastDecompressor == null) {
final int decompressedLen = safeDecompressor.decompress(compressedBuffer, 0, compressedLen, buffer, 0, originalLen);
if (decompressedLen != originalLen) {
throw new IOException("Stream is corrupted");
}
} else {
final int compressedLen2 = fastDecompressor.decompress(compressedBuffer, 0, buffer, 0, originalLen);
if (compressedLen != compressedLen2) {
throw new IOException("Stream is corrupted");
}
}
} catch (LZ4Exception e) {
throw new IOException("Stream is corrupted", e);
}

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Marcono1234
Add test for corrupted LZ4 block input stream
043c458
@Marcono1234
Marcono1234 force-pushed the block-input-stream-corrupted-test branch from e508bad to 043c458 Compare December 2, 2025 13:30
Marcono1234
Marcono1234 commented Dec 2, 2025
View reviewed changes
Comment thread src/test/net/jpountz/lz4/LZ4BlockStreamingTest.java
// Don't create Builder here, otherwise the same Builder instance would be used for all tests, and the
// tests would interfere with each other due to the modifications to the builder
{ (Consumer<LZ4BlockInputStream.Builder>) builder -> builder.withDecompressor(LZ4Factory.fastestInstance().fastDecompressor()) },
{ (Consumer<LZ4BlockInputStream.Builder>) builder -> builder.withDecompressor(LZ4Factory.fastestInstance().safeDecompressor()) }

@Marcono1234 Marcono1234 Dec 2, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this because the previous implementation was quite error-prone: It looks like all test methods in this class used the same LZ4BlockStreamingTest instance, and therefore also the same preInitializedBuilder. Therefore tests could affect each other if they forgot to overwrite / reset all builder configurations.

This happened to me while adding this new test, and due to the usage of randomizedtesting it made the resulting test failures even non-deterministic (unless you reran with the same seed I guess?).

An alternative might be to configure this test to create a new LZ4BlockStreamingTest per test method / test execution (in case that is possible).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@yawkat yawkat Dec 2, 2025

Copy link
Copy Markdown
Owner

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with junit 5 we could use @TestInstance for this… but i guess this approach is more clear, and also allows tests to create multiple streams in one test call

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@yawkat

yawkat commented Dec 2, 2025

Copy link
Copy Markdown
Owner

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yawkat
yawkat merged commit 02bbbf0 into yawkat:main Dec 2, 2025
@Marcono1234
Marcono1234 deleted the block-input-stream-corrupted-test branch December 2, 2025 13:41
mergify Bot added a commit to ArcadeData/arcadedb that referenced this pull request Dec 8, 2025
@mergify
chore(deps): bump at.yawk.lz4:lz4-java from 1.10.0 to 1.10.1 [skip ci]
96be188
Bumps [at.yawk.lz4:lz4-java](https://github.com/yawkat/lz4-java) from 1.10.0 to 1.10.1.
Release notes

*Sourced from [at.yawk.lz4:lz4-java's releases](https://github.com/yawkat/lz4-java/releases).*

> lz4-java v1.10.1
> ----------------
>
> Contains fix for [CVE-2025-66566](GHSA-cmp6-m4wj-q63q)!
>
> What's Changed
> --------------
>
> * Add test for corrupted LZ4 block input stream by [`@​Marcono1234`](https://github.com/Marcono1234) in [yawkat/lz4-java#7](https://redirect.github.com/yawkat/lz4-java/pull/7)
> * Update documentation for checksum registration by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#8](https://redirect.github.com/yawkat/lz4-java/pull/8)
> * Migrate to maven-git-versioning-extension by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#10](https://redirect.github.com/yawkat/lz4-java/pull/10)
> * Add workflow\_dispatch trigger to multi-platform build to allow testing without release by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#13](https://redirect.github.com/yawkat/lz4-java/pull/13)
> * Copy native libraries to target/classes instead of src/resources by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#14](https://redirect.github.com/yawkat/lz4-java/pull/14)
>
> **Full Changelog**: <yawkat/lz4-java@v1.10.0...v1.10.1>


Commits

* [`33d180c`](yawkat/lz4-java@33d180c) Merge commit from fork
* [`da95a00`](yawkat/lz4-java@da95a00) Copy native libraries to target/classes instead of src/resources ([#14](https://redirect.github.com/yawkat/lz4-java/issues/14))
* [`1e9bf8c`](yawkat/lz4-java@1e9bf8c) Add workflow\_dispatch trigger to multi-platform build to allow testing withou...
* [`89c02be`](yawkat/lz4-java@89c02be) Migrate to maven-git-versioning-extension ([#10](https://redirect.github.com/yawkat/lz4-java/issues/10))
* [`d948832`](yawkat/lz4-java@d948832) Update documentation for checksum registration ([#8](https://redirect.github.com/yawkat/lz4-java/issues/8))
* [`02bbbf0`](yawkat/lz4-java@02bbbf0) Add test for corrupted LZ4 block input stream ([#7](https://redirect.github.com/yawkat/lz4-java/issues/7))
* See full diff in [compare view](yawkat/lz4-java@v1.10.0...v1.10.1)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=at.yawk.lz4:lz4-java&package-manager=maven&previous-version=1.10.0&new-version=1.10.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
mergify Bot added a commit to ArcadeData/arcadedb that referenced this pull request Dec 8, 2025
@mergify
chore(deps): bump at.yawk.lz4:lz4-java from 1.10.0 to 1.10.1 in /engi…
9a66254
…ne [skip ci]

Bumps [at.yawk.lz4:lz4-java](https://github.com/yawkat/lz4-java) from 1.10.0 to 1.10.1.
Release notes

*Sourced from [at.yawk.lz4:lz4-java's releases](https://github.com/yawkat/lz4-java/releases).*

> lz4-java v1.10.1
> ----------------
>
> Contains fix for [CVE-2025-66566](GHSA-cmp6-m4wj-q63q)!
>
> What's Changed
> --------------
>
> * Add test for corrupted LZ4 block input stream by [`@​Marcono1234`](https://github.com/Marcono1234) in [yawkat/lz4-java#7](https://redirect.github.com/yawkat/lz4-java/pull/7)
> * Update documentation for checksum registration by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#8](https://redirect.github.com/yawkat/lz4-java/pull/8)
> * Migrate to maven-git-versioning-extension by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#10](https://redirect.github.com/yawkat/lz4-java/pull/10)
> * Add workflow\_dispatch trigger to multi-platform build to allow testing without release by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#13](https://redirect.github.com/yawkat/lz4-java/pull/13)
> * Copy native libraries to target/classes instead of src/resources by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#14](https://redirect.github.com/yawkat/lz4-java/pull/14)
>
> **Full Changelog**: <yawkat/lz4-java@v1.10.0...v1.10.1>


Commits

* [`33d180c`](yawkat/lz4-java@33d180c) Merge commit from fork
* [`da95a00`](yawkat/lz4-java@da95a00) Copy native libraries to target/classes instead of src/resources ([#14](https://redirect.github.com/yawkat/lz4-java/issues/14))
* [`1e9bf8c`](yawkat/lz4-java@1e9bf8c) Add workflow\_dispatch trigger to multi-platform build to allow testing withou...
* [`89c02be`](yawkat/lz4-java@89c02be) Migrate to maven-git-versioning-extension ([#10](https://redirect.github.com/yawkat/lz4-java/issues/10))
* [`d948832`](yawkat/lz4-java@d948832) Update documentation for checksum registration ([#8](https://redirect.github.com/yawkat/lz4-java/issues/8))
* [`02bbbf0`](yawkat/lz4-java@02bbbf0) Add test for corrupted LZ4 block input stream ([#7](https://redirect.github.com/yawkat/lz4-java/issues/7))
* See full diff in [compare view](yawkat/lz4-java@v1.10.0...v1.10.1)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=at.yawk.lz4:lz4-java&package-manager=maven&previous-version=1.10.0&new-version=1.10.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/ArcadeData/arcadedb/network/alerts).
tae898 pushed a commit to humemai/arcadedb-embedded-python that referenced this pull request Jun 28, 2026
@mergify
chore(deps): bump at.yawk.lz4:lz4-java from 1.10.0 to 1.10.1 [skip ci]
5e6decd
Bumps [at.yawk.lz4:lz4-java](https://github.com/yawkat/lz4-java) from 1.10.0 to 1.10.1.
Release notes

*Sourced from [at.yawk.lz4:lz4-java's releases](https://github.com/yawkat/lz4-java/releases).*

> lz4-java v1.10.1
> ----------------
>
> Contains fix for [CVE-2025-66566](GHSA-cmp6-m4wj-q63q)!
>
> What's Changed
> --------------
>
> * Add test for corrupted LZ4 block input stream by [`@​Marcono1234`](https://github.com/Marcono1234) in [yawkat/lz4-java#7](https://redirect.github.com/yawkat/lz4-java/pull/7)
> * Update documentation for checksum registration by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#8](https://redirect.github.com/yawkat/lz4-java/pull/8)
> * Migrate to maven-git-versioning-extension by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#10](https://redirect.github.com/yawkat/lz4-java/pull/10)
> * Add workflow\_dispatch trigger to multi-platform build to allow testing without release by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#13](https://redirect.github.com/yawkat/lz4-java/pull/13)
> * Copy native libraries to target/classes instead of src/resources by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#14](https://redirect.github.com/yawkat/lz4-java/pull/14)
>
> **Full Changelog**: <yawkat/lz4-java@v1.10.0...v1.10.1>


Commits

* [`33d180c`](yawkat/lz4-java@33d180c) Merge commit from fork
* [`da95a00`](yawkat/lz4-java@da95a00) Copy native libraries to target/classes instead of src/resources ([#14](https://redirect.github.com/yawkat/lz4-java/issues/14))
* [`1e9bf8c`](yawkat/lz4-java@1e9bf8c) Add workflow\_dispatch trigger to multi-platform build to allow testing withou...
* [`89c02be`](yawkat/lz4-java@89c02be) Migrate to maven-git-versioning-extension ([#10](https://redirect.github.com/yawkat/lz4-java/issues/10))
* [`d948832`](yawkat/lz4-java@d948832) Update documentation for checksum registration ([#8](https://redirect.github.com/yawkat/lz4-java/issues/8))
* [`02bbbf0`](yawkat/lz4-java@02bbbf0) Add test for corrupted LZ4 block input stream ([#7](https://redirect.github.com/yawkat/lz4-java/issues/7))
* See full diff in [compare view](yawkat/lz4-java@v1.10.0...v1.10.1)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=at.yawk.lz4:lz4-java&package-manager=maven&previous-version=1.10.0&new-version=1.10.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
tae898 pushed a commit to humemai/arcadedb-embedded-python that referenced this pull request Jun 28, 2026
@mergify
chore(deps): bump at.yawk.lz4:lz4-java from 1.10.0 to 1.10.1 in /engi…
250d967
…ne [skip ci]

Bumps [at.yawk.lz4:lz4-java](https://github.com/yawkat/lz4-java) from 1.10.0 to 1.10.1.
Release notes

*Sourced from [at.yawk.lz4:lz4-java's releases](https://github.com/yawkat/lz4-java/releases).*

> lz4-java v1.10.1
> ----------------
>
> Contains fix for [CVE-2025-66566](GHSA-cmp6-m4wj-q63q)!
>
> What's Changed
> --------------
>
> * Add test for corrupted LZ4 block input stream by [`@​Marcono1234`](https://github.com/Marcono1234) in [yawkat/lz4-java#7](https://redirect.github.com/yawkat/lz4-java/pull/7)
> * Update documentation for checksum registration by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#8](https://redirect.github.com/yawkat/lz4-java/pull/8)
> * Migrate to maven-git-versioning-extension by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#10](https://redirect.github.com/yawkat/lz4-java/pull/10)
> * Add workflow\_dispatch trigger to multi-platform build to allow testing without release by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#13](https://redirect.github.com/yawkat/lz4-java/pull/13)
> * Copy native libraries to target/classes instead of src/resources by [`@​yawkat`](https://github.com/yawkat) in [yawkat/lz4-java#14](https://redirect.github.com/yawkat/lz4-java/pull/14)
>
> **Full Changelog**: <yawkat/lz4-java@v1.10.0...v1.10.1>


Commits

* [`33d180c`](yawkat/lz4-java@33d180c) Merge commit from fork
* [`da95a00`](yawkat/lz4-java@da95a00) Copy native libraries to target/classes instead of src/resources ([#14](https://redirect.github.com/yawkat/lz4-java/issues/14))
* [`1e9bf8c`](yawkat/lz4-java@1e9bf8c) Add workflow\_dispatch trigger to multi-platform build to allow testing withou...
* [`89c02be`](yawkat/lz4-java@89c02be) Migrate to maven-git-versioning-extension ([#10](https://redirect.github.com/yawkat/lz4-java/issues/10))
* [`d948832`](yawkat/lz4-java@d948832) Update documentation for checksum registration ([#8](https://redirect.github.com/yawkat/lz4-java/issues/8))
* [`02bbbf0`](yawkat/lz4-java@02bbbf0) Add test for corrupted LZ4 block input stream ([#7](https://redirect.github.com/yawkat/lz4-java/issues/7))
* See full diff in [compare view](yawkat/lz4-java@v1.10.0...v1.10.1)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=at.yawk.lz4:lz4-java&package-manager=maven&previous-version=1.10.0&new-version=1.10.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/ArcadeData/arcadedb/network/alerts).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@yawkat yawkat yawkat left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Marcono1234 @yawkat
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.