mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Fix SF bug #1402308, segfault when using mmap(-1, ...)
This didn't crash on Linux, but valgrind complained. I'm not sure if this test is valid on Windows. Will backport.
This commit is contained in:
parent
ae1df41127
commit
3b4fff8079
5 changed files with 13 additions and 0 deletions
|
|
@ -918,6 +918,7 @@ new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict)
|
|||
#endif
|
||||
m_obj = PyObject_New (mmap_object, &mmap_object_type);
|
||||
if (m_obj == NULL) {return NULL;}
|
||||
m_obj->data = NULL;
|
||||
m_obj->size = (size_t) map_size;
|
||||
m_obj->pos = (size_t) 0;
|
||||
m_obj->fd = dup(fd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue