mirror of https://github.com/python/cpython
#15676: mmap: add empty file check prior to offset check <- Previous patch was incomplete (fix 2)
This commit is contained in:
parent
1f2799bef4
commit
e8db356cf1
|
@ -1345,6 +1345,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) {
|
||||
|
|
Loading…
Reference in New Issue