Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace implementation with Aircompressor code #42

Merged
merged 1 commit into from
May 22, 2024
Merged

Replace implementation with Aircompressor code #42

merged 1 commit into from
May 22, 2024

Conversation

dain
Copy link
Owner

@dain dain commented May 21, 2024

The core compression and decompression code has been replaced with the latest code from Aircompressor. The existing interfaces have been retained where possible. The notable exceptions:

  • The deprecated SnappyInputStream and SnappyOutputStream output stream implementations have been removed. Any existing data in these formats should be converted to the specification defined framed formats using an older version of this library.
  • Little endian is no longer supported
  • The minimum Java version is now 1.8

@dain dain requested a review from electrum May 21, 2024 03:13
@dain dain force-pushed the fix-cve branch 7 times, most recently from 362bec6 to ea71a42 Compare May 21, 2024 03:27
@dain
Copy link
Owner Author

dain commented May 21, 2024

@Marcono1234 this PR brings iq80 snappy in line with aircompressor

The core compression and decompression code has been replaced with the
latest code from Aircompressor. The existing interfaces have been
retained where possible. The notable exception is the deprecated
SnappyInputStream and SnappyOutputStream output stream implementations
have been removed. Any existing data in these formats should be
converted to the specification defined framed formats using an
older version of this library.
@Marcono1234
Copy link

Marcono1234 commented May 22, 2024

This also drops support for big endian CPUs (which would currently be using SlowMemory), right?

Maybe another alternative would be to always use SlowMemory, and never UnsafeMemory. This would probably keep the same functionality, but maybe this performance decrease is not acceptable. Though on the other hand this at least solves the issue, and users are encouraged to migrate to Aircompressor anyway.

Or alternatively, fix only the missing / incorrect checks which cause the issue. But I will probably test again then if there are any remaining similar issues (and I cannot guarantee that I won't overlook something).

(Though of course in the end it is your decision, so consider everything I wrote above only as suggestion please.)

@dain
Copy link
Owner Author

dain commented May 22, 2024

Honestly there are so few modern shipping systems that are big endian (PPC and s390x), I don't think it is worth the effort. If someone really complained loudly, I could likely add it back.

BTW, I considered just patching the problems, but I haven't looked at this repository in ages. Like it was Java 1.6, and I can't even download a JVM for that on my machine. Really, folks should upgrade, so I made this change so it will be easy to copy any future CVE fixes from aircompressor.

@dain dain merged commit d31f382 into master May 22, 2024
2 checks passed
@dain dain deleted the fix-cve branch May 22, 2024 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants