[New-bugs-announce] [issue3946] PyObject_CheckReadBuffer crashes on memoryview object

Roger Upole report at bugs.python.org
Tue Sep 23 15:55:58 CEST 2008


New submission from Roger Upole <rupole at hotmail.com>:

Sample code:
	PyObject *b=PyBytes_FromString("eh ?????");
	PyObject *mv=PyMemoryView_FromObject(b);
	PyObject_CheckReadBuffer(mv);

>From following the chain of calls in PyObject_CheckReadBuffer,
a few things are unclear.

It calls bf_getbuffer with a NULL Py_Buffer pointer, although the PEP
explicitely states that is should never be NULL.

PyBuffer_FillInfo immediately returns success if the view pointer is
NULL.  I'm guessing this is to just determine if the operation could be
completed, but it returns before any checks are done.

It then attempts to release a hardcoded NULL Py_buffer pointer
which of course crashes.

----------
messages: 73640
nosy: rupole
severity: normal
status: open
title: PyObject_CheckReadBuffer crashes on memoryview object

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3946>
_______________________________________


More information about the New-bugs-announce mailing list