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

getargs.c: release the buffer on error #53172

Closed
vstinner opened this issue Jun 6, 2010 · 2 comments
Closed

getargs.c: release the buffer on error #53172

vstinner opened this issue Jun 6, 2010 · 2 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@vstinner
Copy link
Member

vstinner commented Jun 6, 2010

BPO 8926
Nosy @vstinner
Files
  • getarg_release.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 = None
    closed_at = <Date 2010-06-24.23:06:49.591>
    created_at = <Date 2010-06-06.19:11:09.115>
    labels = ['interpreter-core']
    title = 'getargs.c: release the buffer on error'
    updated_at = <Date 2010-06-24.23:06:49.589>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2010-06-24.23:06:49.589>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-06-24.23:06:49.591>
    closer = 'vstinner'
    components = ['Interpreter Core']
    creation = <Date 2010-06-06.19:11:09.115>
    creator = 'vstinner'
    dependencies = []
    files = ['17577']
    hgrepos = []
    issue_num = 8926
    keywords = ['patch']
    message_count = 2.0
    messages = ['107210', '108562']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue8926'
    versions = ['Python 3.2']

    @vstinner
    Copy link
    Member Author

    vstinner commented Jun 6, 2010

    PyArg_ParseTuple("t") calls PyObject_GetBuffer() and then raise an error if arg->ob_type->tp_as_buffer->bf_releasebuffer is not NULL. I think that it should call PyBuffer_Release(&view) before raising the error, or simply check bf_releasebuffer before calling PyObject_GetBuffer().

    getbuffer() calls PyObject_GetBuffer() and then raise an error if the buffer is not contiguous. I think that it should call PyBuffer_Release() before the error.

    Attached patch fixes both errors.

    Tell me if I'm wrong :-)

    @vstinner vstinner added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jun 6, 2010
    @vstinner
    Copy link
    Member Author

    Fixed in r82206 and r82207.

    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant