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

Appending to ZIP archive blows up existing Central Directory entries #78522

Closed
serhiy-storchaka opened this issue Aug 6, 2018 · 5 comments
Closed
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 34341
Nosy @Yhg1s, @serhiy-storchaka, @miss-islington
PRs
  • bpo-34341: Fix appending to ZIP archives with the ZIP64 extension. #8683
  • [3.7] bpo-34341: Fix appending to ZIP archives with the ZIP64 extension. (GH-8683) #9356
  • [3.6] bpo-34341: Fix appending to ZIP archives with the ZIP64 extension. (GH-8683) #9357
  • [2.7] bpo-34341: Fix appending to ZIP archives with the ZIP64 extension. (GH-8683). #9400
  • 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 = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2018-09-18.20:34:16.711>
    created_at = <Date 2018-08-06.07:57:50.199>
    labels = ['3.7', '3.8', 'type-bug', 'library']
    title = 'Appending to ZIP archive blows up existing Central Directory entries'
    updated_at = <Date 2018-09-18.20:34:16.710>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2018-09-18.20:34:16.710>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2018-09-18.20:34:16.711>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2018-08-06.07:57:50.199>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34341
    keywords = ['patch']
    message_count = 5.0
    messages = ['323181', '325536', '325539', '325542', '325679']
    nosy_count = 4.0
    nosy_names = ['twouters', 'alanmcintyre', 'serhiy.storchaka', 'miss-islington']
    pr_nums = ['8683', '9356', '9357', '9400']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue34341'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7', 'Python 3.8']

    @serhiy-storchaka
    Copy link
    Member Author

    When the ZIP archive is opened for appending, it reads the Central Directory at opening and writes existing entries back at closing. The Zip64 Extra Field is appended to existing Extra Fields if necessary. This leads to increasing the size of the Extra Fields data every time when append to the ZIP archive. Since the total size of Extra Fields is limited by 0xffff bytes, this can cause the failure.

    The proposed PR removes the Zip64 Extra Field before adding a new Zip64 Extra Field.

    @serhiy-storchaka serhiy-storchaka added 3.8 only security fixes 3.7 (EOL) end of life labels Aug 6, 2018
    @serhiy-storchaka serhiy-storchaka self-assigned this Aug 6, 2018
    @serhiy-storchaka serhiy-storchaka added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Aug 6, 2018
    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 9bdb7be by Serhiy Storchaka in branch 'master':
    bpo-34341: Fix appending to ZIP archives with the ZIP64 extension. (GH-8683)
    9bdb7be

    @miss-islington
    Copy link
    Contributor

    New changeset efdf316 by Miss Islington (bot) in branch '3.7':
    bpo-34341: Fix appending to ZIP archives with the ZIP64 extension. (GH-8683)
    efdf316

    @miss-islington
    Copy link
    Contributor

    New changeset 83a0985 by Miss Islington (bot) in branch '3.6':
    bpo-34341: Fix appending to ZIP archives with the ZIP64 extension. (GH-8683)
    83a0985

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 29034ba by Serhiy Storchaka in branch '2.7':
    [2.7] bpo-34341: Fix appending to ZIP archives with the ZIP64 extension. (GH-8683). (GH-9400)
    29034ba

    @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.7 (EOL) end of life 3.8 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

    2 participants