MERGE: #15676: mmap: add empty file check prior to offset check <- Previous patch was incomplete (fix 2)

This commit is contained in:
Jesus Cea 2012-09-10 22:58:35 +02:00
commit 67bd81b867

View file

@ -1367,6 +1367,7 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
if (size == 0) {
PyErr_SetString(PyExc_ValueError,
"cannot mmap an empty file");
Py_DECREF(m_obj);
return NULL;
}
if (offset >= size) {