Message154969
bytearray_getbuffer() checks for view==NULL. But this has never been
allowed:
PEP: "The second argument is the address to a bufferinfo structure.
Both arguments must never be NULL."
DOCS (3.2): "view must point to an existing Py_buffer structure
allocated by the caller".
A quick grep through the source tree shows no instances where
the middle argument of either PyObject_GetBuffer of bf_getbuffer
is NULL or 0.
Patch attached, all tests pass. I wouldn't be comfortable to
commit it without review though (it's just too strange).
BTW, the next conditional in bytearray_getbuffer ...
if (ret >= 0) {
obj->ob_exports++;
}
is also superfluous, since PyBuffer_FillInfo() cannot fail
if readonly==0. |
|
Date |
User |
Action |
Args |
2012-03-05 18:32:49 | skrah | set | recipients:
+ skrah, ncoghlan, pitrou |
2012-03-05 18:32:49 | skrah | set | messageid: <1330972369.17.0.543217676638.issue14203@psf.upfronthosting.co.za> |
2012-03-05 18:32:48 | skrah | link | issue14203 messages |
2012-03-05 18:32:48 | skrah | create | |
|