Author skrah
Recipients ncoghlan, pitrou, skrah
Date 2012-03-05.18:32:48
SpamBayes Score 4.48444e-07
Marked as misclassified No
Message-id <>
bytearray_getbuffer() checks for view==NULL. But this has never been

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) {

is also superfluous, since PyBuffer_FillInfo() cannot fail
if readonly==0.
Date User Action Args
2012-03-05 18:32:49skrahsetrecipients: + skrah, ncoghlan, pitrou
2012-03-05 18:32:49skrahsetmessageid: <>
2012-03-05 18:32:48skrahlinkissue14203 messages
2012-03-05 18:32:48skrahcreate