From: Alexandre Vassalotti Date: Tue, 10 Jun 2008 16:43:26 +0000 (+0000) Subject: Fixed _bsddb key allocation errors. X-Git-Tag: v3.0b1~123 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=250788453fa64adef423b4f5b0294922c91a4c46;p=thirdparty%2FPython%2Fcpython.git Fixed _bsddb key allocation errors. --- diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c index 3a67a1e600a8..9e3102967c51 100644 --- a/Modules/_bsddb.c +++ b/Modules/_bsddb.c @@ -312,6 +312,10 @@ static Py_buffer * _malloc_view(PyObject *obj) "Py_buffer malloc failed"); return NULL; } + + if (PyObject_GetBuffer(obj, view, PyBUF_SIMPLE)) + return NULL; + if (view->ndim > 1) { PyErr_SetString(PyExc_BufferError, "buffers must be single dimension");