Message251922
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;
} |
|
Date |
User |
Action |
Args |
2015-09-30 10:35:24 | lemburg | set | recipients:
+ lemburg, doerwalter, benjamin.peterson, berker.peksag, The Compiler, reaperhulk, Bruno Oliveira |
2015-09-30 10:35:24 | lemburg | set | messageid: <1443609324.89.0.754319653808.issue25270@psf.upfronthosting.co.za> |
2015-09-30 10:35:24 | lemburg | link | issue25270 messages |
2015-09-30 10:35:24 | lemburg | create | |
|