Skip to content

_ssl.c refcount bug #127761

@wjssz

Description

@wjssz

Bug report

Bug description:

These two sites forget to Py_INCREF() to the return value.
The bug commit 4c53b25, by @ZeroIntensity, @picnixz.

cpython/Modules/_ssl.c

Lines 2945 to 2951 in 2041a95

static PyObject *
_ssl__SSLSocket_session_reused_get_impl(PySSLSocket *self)
/*[clinic end generated code: output=c8916909bcb80893 input=cec8bfec73a4461e]*/
{
int res = SSL_session_reused(self->ssl);
return res ? Py_True : Py_False;
}

cpython/Modules/_ssl.c

Lines 5607 to 5613 in 2041a95

static PyObject *
_ssl_SSLSession_has_ticket_get_impl(PySSLSession *self)
/*[clinic end generated code: output=aa3ccfc40b10b96d input=fa475555f53a5086]*/
{
int res = SSL_SESSION_has_ticket(self->session);
return res ? Py_True : Py_False;
}

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux, macOS, Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions