]> granicus.if.org Git - python/commitdiff
Fixed _bsddb key allocation errors.
authorAlexandre Vassalotti <alexandre@peadrop.com>
Tue, 10 Jun 2008 16:43:26 +0000 (16:43 +0000)
committerAlexandre Vassalotti <alexandre@peadrop.com>
Tue, 10 Jun 2008 16:43:26 +0000 (16:43 +0000)
Modules/_bsddb.c

index 3a67a1e600a8c5f2db0e34434afd87a21230567c..9e3102967c51f0dfed7037bb615bb06c6c23f5d5 100644 (file)
@@ -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");