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

zipfile.py bug 755031; null byte in file name #38667

Closed
ahlstromjc mannequin opened this issue Jun 17, 2003 · 2 comments
Closed

zipfile.py bug 755031; null byte in file name #38667

ahlstromjc mannequin opened this issue Jun 17, 2003 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@ahlstromjc
Copy link
Mannequin

ahlstromjc mannequin commented Jun 17, 2003

BPO 755987
Files
  • zipfile.diff: diff against 6-17-2003 CVS zipfile.py
  • 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 2003-06-18.01:07:57.000>
    created_at = <Date 2003-06-17.15:47:13.000>
    labels = ['library']
    title = 'zipfile.py bug 755031; null byte in file name'
    updated_at = <Date 2003-06-18.01:07:57.000>
    user = 'https://bugs.python.org/ahlstromjc'

    bugs.python.org fields:

    activity = <Date 2003-06-18.01:07:57.000>
    actor = 'gward'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2003-06-17.15:47:13.000>
    creator = 'ahlstromjc'
    dependencies = []
    files = ['5387']
    hgrepos = []
    issue_num = 755987
    keywords = ['patch']
    message_count = 2.0
    messages = ['44047', '44048']
    nosy_count = 2.0
    nosy_names = ['gward', 'ahlstromjc']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue755987'
    versions = ['Python 2.3']

    @ahlstromjc
    Copy link
    Mannequin Author

    ahlstromjc mannequin commented Jun 17, 2003

    This is a patch for Bug 755031: If a null byte appears in
    a file name, Python zipfile.py retains it, but InfoZip
    terminates the name. Null bytes in file names are used
    as a trick by viruses. I tested WinZip, and it also
    truncates the file name at the null byte.

    I am about 80% sure this patch is a good idea, but it
    does add a little more complexity. If the consensus is
    that virus files are not Python's problem, I won't be
    offended if it is rejected. It does seem useful to be
    consistent with WinZip and InfoZip.

    The patch also fixes a buglet: If a zipfile incorrectly
    uses a directory separator other than '/', there was an
    invalid complaint that the central directory name does
    not match the file header name.

    I also removed my name from the top of the file. It was
    there for legal reasons which I believe no longer apply.
    Many people have worked on this file besides me.

    I don't believe there should be a test for null bytes in
    the zipfile.py test suite.

    @ahlstromjc ahlstromjc mannequin closed this as completed Jun 17, 2003
    @ahlstromjc ahlstromjc mannequin added the stdlib Python modules in the Lib dir label Jun 17, 2003
    @gward
    Copy link
    Mannequin

    gward mannequin commented Jun 18, 2003

    Logged In: YES
    user_id=14422

    Thanks Jim! Your patch works for me, and the test still
    passes. I've checked it in on the trunk (rev 1.29, 1.30)
    and backported it to release22-maint branch.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants