Commit 67bd81b8 authored by Jesus Cea's avatar Jesus Cea

MERGE: #15676: mmap: add empty file check prior to offset check <- Previous...

MERGE: #15676: mmap: add empty file check prior to offset check <- Previous patch was incomplete (fix 2)
parents 4886d5b3 e8db356c
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment