Skip to content

bpo-45507: Throw EOF error when gzip headers or trailers are truncated - #29023

Closed
rhpvorderman wants to merge 2 commits into
python:mainfrom
rhpvorderman:patch-1
Closed

bpo-45507: Throw EOF error when gzip headers or trailers are truncated#29023
rhpvorderman wants to merge 2 commits into
python:mainfrom
rhpvorderman:patch-1

Conversation

@rhpvorderman

@rhpvordermanrhpvorderman commented Oct 18, 2021

Copy link
Copy Markdown
Contributor

This is to keep error compatibility with 3.10 and lower.

It was missed in my last PR #27941. When the gzip member contains an incomplete trailer (less than 8 bytes) the GzipFile-based implementation of 3.10 and below would throuw an EOF error, so the newer in-memory implementation should do the same.
Currently it throws 'struct.error: unpack requires a buffer of 8 bytes' when the trailer is truncated.

https://bugs.python.org/issue45507

@rhpvorderman

rhpvorderman commented Oct 18, 2021

Copy link
Copy Markdown
ContributorAuthor

This can have a 'skip news' label, but I can't add it myself. Added regression tests now and added a news item accordingly.

This is to keep error compatibility with 3.10 and lower.
@rhpvordermanrhpvorderman changed the title bpo-45507: Throw EOF error when trailer is not present in gzip memberbpo-45507: Throw EOF error when gzip headers or trailers are truncatedOct 18, 2021
@rhpvorderman

Copy link
Copy Markdown
ContributorAuthor

Closing this PR as it confounds two issues: Header and trailer

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@rhpvorderman@the-knights-who-say-ni@bedevere-bot