#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:07 +02:00
parent 1f2799bef4
commit e8db356cf1
1 changed files with 1 additions and 0 deletions

View File

@ -1345,6 +1345,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) {