This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients josh.r, martin.panter, serhiy.storchaka, squidevil
Date 2016-01-30.07:39:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1454139565.76.0.737593625317.issue26168@psf.upfronthosting.co.za>
In-reply-to
Content
Rather rare reference leak is not the worst bug here.

Following example

    const char *s = ...;
    PyObject *b = PyBytes_New(...);
    return PyBuildValue("(Ns)s", b, s, PyBytes_AS_STRING(b));

works if s is correct UTF-8 encoded string. But if it is not correct UTF-8 encoded string, the first "s" is failed and the inner tuple is deallocated together with the borrowed reference to b. The second "s" then reads freed memory.
History
Date User Action Args
2016-01-30 07:39:25serhiy.storchakasetrecipients: + serhiy.storchaka, martin.panter, josh.r, squidevil
2016-01-30 07:39:25serhiy.storchakasetmessageid: <1454139565.76.0.737593625317.issue26168@psf.upfronthosting.co.za>
2016-01-30 07:39:25serhiy.storchakalinkissue26168 messages
2016-01-30 07:39:25serhiy.storchakacreate