Skip to content
New issue

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

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

Already on GitHub? # to your account

Backport #177 to 1.9 #179

Merged
merged 3 commits into from
Sep 16, 2022
Merged

Conversation

Lukasa
Copy link
Contributor

@Lukasa Lukasa commented Sep 16, 2022

This is a backport of #177 to the 1.9 release series, supporting Swift 5.0. It contains an extra patch to ensure that we do not add new API, making it possible for this to be 1.9.2.

Motivation

Currently we don't confirm that the decompression has completed
successfully. This means that we can incorrectly spin forever attempting
to decompress past the end of a message, and that we can fail to notice
that a message is truncated. Neither of these is good.

Modifications

Propagate the message zlib gives us as to whether or not decompression
is done, and keep track of it.
Add some tests written by @vojtarylko to validate the behaviour.

Result

Correctly police the bounds of the messages.
Resolves apple#175 and apple#176.

(cherry picked from commit 6c84d24)
@Lukasa Lukasa added the 🔨 semver/patch No public API change. label Sep 16, 2022
@Lukasa Lukasa changed the title Cb backport 177 to 19 Backport #177 to 1.9 Sep 16, 2022
@Lukasa Lukasa merged commit e800075 into apple:nio-extras-1.9 Sep 16, 2022
@Lukasa Lukasa deleted the cb-backport-177-to-19 branch September 16, 2022 08:30
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants