#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:57:34 +02:00
parent 20f0ea1f61
commit 8e03b4cae0
1 changed files with 1 additions and 0 deletions

View File

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