diff options
author | Christian Heimes <christian@cheimes.de> | 2008-02-15 08:20:11 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-02-15 08:20:11 (GMT) |
commit | 7adfad850a50722464775d57b5d16b850ecab56a (patch) | |
tree | 876709cd5987e91a120a0d9af22764663237f9e6 /Modules/mmapmodule.c | |
parent | 2f0da53d28b316197a94919c96195a514acc668f (diff) | |
download | cpython-7adfad850a50722464775d57b5d16b850ecab56a.zip cpython-7adfad850a50722464775d57b5d16b850ecab56a.tar.gz cpython-7adfad850a50722464775d57b5d16b850ecab56a.tar.bz2 |
Bug #2111: mmap segfaults when trying to write a block opened with PROT_READ
Thanks to Thomas Herve for the fix.
Diffstat (limited to 'Modules/mmapmodule.c')
-rw-r--r-- | Modules/mmapmodule.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 49fe7f7..e47211f 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -1122,6 +1122,10 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict) "mmap invalid access parameter."); } + if (prot == PROT_READ) { + access = ACCESS_READ; + } + #ifdef HAVE_FSTAT # ifdef __VMS /* on OpenVMS we must ensure that all bytes are written to the file */ |