summaryrefslogtreecommitdiffstats
path: root/Modules/mmapmodule.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-01-11 08:54:45 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-01-11 08:54:45 (GMT)
commit3b4fff8079834433ba75ee0873c538410cd082c9 (patch)
tree7301da8a2959b7ca9d28db9beb5f9af55eef3f4e /Modules/mmapmodule.c
parentae1df4112710fdfc7ffb6248b6a61b6b3cadd880 (diff)
downloadcpython-3b4fff8079834433ba75ee0873c538410cd082c9.zip
cpython-3b4fff8079834433ba75ee0873c538410cd082c9.tar.gz
cpython-3b4fff8079834433ba75ee0873c538410cd082c9.tar.bz2
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.
Diffstat (limited to 'Modules/mmapmodule.c')
-rw-r--r--Modules/mmapmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index dbb3fcd..2ff4494 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -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);