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

Small oversight in 3.11 gzip.decompress implementation with regards to backwards compatibility #89670

Closed
rhpvorderman mannequin opened this issue Oct 18, 2021 · 5 comments
Labels
3.11 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@rhpvorderman
Copy link
Mannequin

rhpvorderman mannequin commented Oct 18, 2021

BPO 45507
Nosy @ambv, @rhpvorderman
PRs
  • bpo-45507: Throw EOF error when gzip headers or trailers are truncated #29023
  • bpo-45507: EOFErrors should be thrown for truncated gzip members #29029
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-11-19.18:44:42.893>
    created_at = <Date 2021-10-18.08:51:32.403>
    labels = ['type-bug', 'library', '3.11']
    title = 'Small oversight in 3.11 gzip.decompress implementation with regards to backwards compatibility'
    updated_at = <Date 2021-11-19.18:44:42.892>
    user = 'https://github.com/rhpvorderman'

    bugs.python.org fields:

    activity = <Date 2021-11-19.18:44:42.892>
    actor = 'lukasz.langa'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-11-19.18:44:42.893>
    closer = 'lukasz.langa'
    components = ['Library (Lib)']
    creation = <Date 2021-10-18.08:51:32.403>
    creator = 'rhpvorderman'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45507
    keywords = ['patch']
    message_count = 5.0
    messages = ['404165', '404169', '405782', '406603', '406608']
    nosy_count = 2.0
    nosy_names = ['lukasz.langa', 'rhpvorderman']
    pr_nums = ['29023', '29029']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue45507'
    versions = ['Python 3.11']

    @rhpvorderman
    Copy link
    Mannequin Author

    rhpvorderman mannequin commented Oct 18, 2021

    A 'struct.error: unpack requires a buffer of 8 bytes' is thrown when a gzip trailer is truncated instead of an EOFError such as in the 3.10 and prior releases.

    @rhpvorderman rhpvorderman mannequin added 3.11 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Oct 18, 2021
    @rhpvorderman
    Copy link
    Mannequin Author

    rhpvorderman mannequin commented Oct 18, 2021

    It turns out there is a bug where FNAME and/or FCOMMENT flags are set in the header, but no error is thrown when NAME and COMMENT fields are missing.

    @rhpvorderman
    Copy link
    Mannequin Author

    rhpvorderman mannequin commented Nov 5, 2021

    bump. This is a regression introduced by #27941

    @ambv
    Copy link
    Contributor

    ambv commented Nov 19, 2021

    New changeset 0ff3d95 by Ruben Vorderman in branch 'main':
    bpo-45507: EOFErrors should be thrown for truncated gzip members (GH-29029)
    0ff3d95

    @ambv
    Copy link
    Contributor

    ambv commented Nov 19, 2021

    Thanks for noticing, Ruben! ✨ 🍰 ✨

    @ambv ambv closed this as completed Nov 19, 2021
    @ambv ambv closed this as completed Nov 19, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant