FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ZlibStream: Only verify Adler32 checksum if all data was read by qmfrederik · Pull Request #243 · DiscUtils/DiscUtils · GitHub

ZlibStream: Only verify Adler32 checksum if all data was read - #243

Open
qmfrederik wants to merge 1 commit into
DiscUtils:developfrom
qmfrederik:fixes/zlibstream-dispose
Open

ZlibStream: Only verify Adler32 checksum if all data was read#243
qmfrederik wants to merge 1 commit into
DiscUtils:developfrom
qmfrederik:fixes/zlibstream-dispose

Conversation

Copy link
Copy Markdown
Contributor

The .Dispose method in ZlibStream will attempt to verify the Adler32 checksum at the end of the stream.

The check will fail if not all decompressed data was read, since not all data was checksummed and the checksum will not match.

This PR updates the .Dispose logic a bit to only validate the checksum when we're sure all decompressed data has been read.

Copy link
Copy Markdown
Contributor Author

It's a bit shady to do checksum validation in a .Dispose method and to throw from there, since .Dispose should never throw.

@LordMike what do you think?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL