mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
MERGE: #15676: mmap: add empty file check prior to offset check <- Previous patch was incomplete (fix 2)
This commit is contained in:
commit
67bd81b867
1 changed files with 1 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue