Skip to content

Segfault in ZstdCompressorIterator_iternext with buffer-protocol data #303

@arnimarj

Description

@arnimarj

Hi,

I've been experimenting with passing memoryviews into read_to_iter, and I've been hitting segfaults pretty regularly on large pieces of data.

The offending line is Py_DECREF(self->readResult) in compressoriterator.c. For input data passed in as buffer objects, this pointer (self->readResult) is never not-null.

I've been unable to create a small re-producer which hits these conditions:

    if (self->input.pos < self->input.size) {
        ...

        if (self->input.pos == self->input.size) {
            ...
            Py_DECREF(self->readResult);
            ...
        }

But I'll keep trying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions