-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
compress/flate: Close is not idempotent #27741
Labels
FrozenDueToAge
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Comments
bcmills
added
the
NeedsFix
The path to resolution is known, but the work has not been done.
label
Sep 19, 2018
Do you have a change pending, or should this be “help wanted”? |
I have no pending change. Great change for interested contributor. I can review. |
Change https://golang.org/cl/136475 mentions this issue: |
Change https://go.dev/cl/403514 mentions this issue: |
gopherbot
pushed a commit
that referenced
this issue
May 2, 2022
The compressor methods already have logic for handling a sticky error. Merge the logic from CL 136475 into that. This slightly changes the error message to be more sensible in the situation where it's returned by Flush. Updates #27741 Change-Id: Ie34cf3164d0fa6bd0811175ca467dbbcb3be1395 Reviewed-on: https://go-review.googlesource.com/c/go/+/403514 Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
The
flate.Writer.Close
should be an idempotent operation. Furthermore, it should disallow further calls toWrite
:Currently, this prints:
I expect it to print something like:
Currently, allowing a
Write
after aClose
results in a corrupted stream. The trailing42e100020000ffff
is indicative of a backwards reference to the previous block. However, this is invalid since the previous block terminated the stream with the FINAL bit set.This hasn't been much of a problem in practice since almost all usages of
flate
are throughgzip
, which does have this property.The text was updated successfully, but these errors were encountered: