[issue8105] mmap crash on Windows with out of range file descriptor
Brian Curtin
report at bugs.python.org
Wed Mar 10 01:42:26 CET 2010
New submission from Brian Curtin <curtin at acm.org>:
Creating an mmap object can crash the interpreter on Windows if a file descriptor is passed in which is outside of the range for _get_osfhandle. I noticed the crash possibility while reviewing the Modules/mmapmodule.c code for work on another issue related to the consistency of the exceptions which mmap raises.
This can be tested by creating a mmap object with the file descriptor for a socket. This is not a valid way to create an mmap, but it represents a valid file descriptor which is out of range. For example, I created a socket with a file descriptor of 124, and _get_osfhandle expects the descriptor to be between 0 and 23.
Patch against trunk, with a test.
Note that this does not seem to affect 2.6 (not sure why, yet).
----------
components: Library (Lib), Windows
files: mmap_crash.diff
keywords: patch
messages: 100774
nosy: brian.curtin
priority: normal
severity: normal
stage: patch review
status: open
title: mmap crash on Windows with out of range file descriptor
type: crash
versions: Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file16515/mmap_crash.diff
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8105>
_______________________________________
More information about the Python-bugs-list
mailing list