diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-01-11 08:54:45 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-01-11 08:54:45 (GMT) |
commit | 3b4fff8079834433ba75ee0873c538410cd082c9 (patch) | |
tree | 7301da8a2959b7ca9d28db9beb5f9af55eef3f4e /Lib/test/test_mmap.py | |
parent | ae1df4112710fdfc7ffb6248b6a61b6b3cadd880 (diff) | |
download | cpython-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 'Lib/test/test_mmap.py')
-rw-r--r-- | Lib/test/test_mmap.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py index 849f170..6930317 100644 --- a/Lib/test/test_mmap.py +++ b/Lib/test/test_mmap.py @@ -281,6 +281,14 @@ def test_both(): except OSError: pass + print ' Try opening a bad file descriptor...' + try: + mmap.mmap(-1, 4096) + except mmap.error: + pass + else: + verify(0, 'expected a mmap.error but did not get it') + # Do a tougher .find() test. SF bug 515943 pointed out that, in 2.2, # searching for data with embedded \0 bytes didn't work. f = open(TESTFN, 'w+') |