commit | 8e03b4cae0cf37aac52827523fb3cf56894ffdf9 | [log] [tgz] |
---|---|---|
author | Jesus Cea <jcea@jcea.es> | Mon Sep 10 22:57:34 2012 +0200 |
committer | Jesus Cea <jcea@jcea.es> | Mon Sep 10 22:57:34 2012 +0200 |
tree | 0aaf5847664f4642d27bdbae6463f2564b74120e | |
parent | 20f0ea1f610842c98bbfcf653f4414b88f767083 [diff] [blame] |
#15676: mmap: add empty file check prior to offset check <- Previous patch was incomplete (fix 2)
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 62d934c..03685ce 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c
@@ -1391,6 +1391,7 @@ if (size == 0) { PyErr_SetString(PyExc_ValueError, "cannot mmap an empty file"); + Py_DECREF(m_obj); return NULL; } if (offset >= size) {