commit | e8db356cf1084105a97db9457a2374209868005b | [log] [tgz] |
---|---|---|
author | Jesus Cea <jcea@jcea.es> | Mon Sep 10 22:58:07 2012 +0200 |
committer | Jesus Cea <jcea@jcea.es> | Mon Sep 10 22:58:07 2012 +0200 |
tree | 92510438a6883be8022200d886880d3f44c1e77d | |
parent | 1f2799bef45673419e96ad4ef6a923c59d1c6a85 [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 b993fdf..33c143e 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c
@@ -1345,6 +1345,7 @@ if (size == 0) { PyErr_SetString(PyExc_ValueError, "cannot mmap an empty file"); + Py_DECREF(m_obj); return NULL; } if (offset >= size) {