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

in zlib decompressor objects, unused_data and unconsumed_tail must be immutable #48040

Closed
pitrou opened this issue Sep 6, 2008 · 2 comments
Closed
Assignees
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@pitrou
Copy link
Member

pitrou commented Sep 6, 2008

BPO 3790
Nosy @gpshead, @pitrou
Files
  • zlib_unconsumed_tail.patch
  • 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/gpshead'
    closed_at = <Date 2008-09-06.20:15:27.045>
    created_at = <Date 2008-09-06.00:16:30.415>
    labels = ['extension-modules', 'type-bug']
    title = 'in zlib decompressor objects, unused_data and unconsumed_tail must be immutable'
    updated_at = <Date 2008-09-06.20:15:27.044>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2008-09-06.20:15:27.044>
    actor = 'gregory.p.smith'
    assignee = 'gregory.p.smith'
    closed = True
    closed_date = <Date 2008-09-06.20:15:27.045>
    closer = 'gregory.p.smith'
    components = ['Extension Modules']
    creation = <Date 2008-09-06.00:16:30.415>
    creator = 'pitrou'
    dependencies = []
    files = ['11403']
    hgrepos = []
    issue_num = 3790
    keywords = ['patch', 'needs review']
    message_count = 2.0
    messages = ['72652', '72687']
    nosy_count = 2.0
    nosy_names = ['gregory.p.smith', 'pitrou']
    pr_nums = []
    priority = 'critical'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue3790'
    versions = ['Python 3.0']

    @pitrou
    Copy link
    Member Author

    pitrou commented Sep 6, 2008

    Currently (in py3k), the attributes "unused_data" and "unconsumed_tail"
    on zlib decompressor objects are bytearrays. This can wreak havoc in the
    read() method of ZipInfo objects, because one of those bytearrays is
    assigned to the internal "rawbuffer" and then extended using "+="...
    leading to wrong results (right now I can only reproduce it on a 3.5 GB
    zip file, sorry :-( ).

    Here is a patch.

    @pitrou pitrou added extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error labels Sep 6, 2008
    @gpshead gpshead self-assigned this Sep 6, 2008
    @gpshead
    Copy link
    Member

    gpshead commented Sep 6, 2008

    fixed in r66266 along with bpo-3492.

    @gpshead gpshead closed this as completed Sep 6, 2008
    @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
    extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants