Author lemburg
Recipients Bruno Oliveira, The Compiler, benjamin.peterson, berker.peksag, doerwalter, lemburg, reaperhulk
Date 2015-09-30.10:35:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1443609324.89.0.754319653808.issue25270@psf.upfronthosting.co.za>
In-reply-to
Content
The patch looks fine to me, but I still wonder how p - PyBytes_AS_STRING(v) can be negative when size == 0...

Ah, now I get it: the new size is 0, but the refcount is not 1, since the nullstring is shared. This causes the exception.

From _PyBytes_Resize():

    if (!PyBytes_Check(v) || Py_REFCNT(v) != 1 || newsize < 0) {
        *pv = 0;
        Py_DECREF(v);
        PyErr_BadInternalCall();
        return -1;
    }
History
Date User Action Args
2015-09-30 10:35:24lemburgsetrecipients: + lemburg, doerwalter, benjamin.peterson, berker.peksag, The Compiler, reaperhulk, Bruno Oliveira
2015-09-30 10:35:24lemburgsetmessageid: <1443609324.89.0.754319653808.issue25270@psf.upfronthosting.co.za>
2015-09-30 10:35:24lemburglinkissue25270 messages
2015-09-30 10:35:24lemburgcreate