This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dogbert2
Recipients dogbert2
Date 2015-04-03.17:43:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1428083040.47.0.668729418368.issue23860@psf.upfronthosting.co.za>
In-reply-to
Content
Hello All,

   In reviewing code in directory Python-3.4.3/Modules, file 
'mmapmodule', I found a call to 'lseek()' without a check for
a return value of -1, indicating failure.  The patch file below
corrects this issue (diff -u format):

--- mmapmodule.c.orig	2015-04-02 19:05:30.380554538 -0700
+++ mmapmodule.c	2015-04-02 19:11:00.320488207 -0700
@@ -1335,7 +1335,11 @@
             return NULL;
         }
         /* Win9x appears to need us seeked to zero */
-        lseek(fileno, 0, SEEK_SET);
+	if (lseek(fileno, 0, SEEK_SET) == -1) { /* call to lseek() failed */
+	    PyErr_SetFromErrno(PyExc_OSError);
+	    return NULL;
+	}
+
     }
 
     m_obj = (mmap_object *)type->tp_alloc(type, 0);

I am attaching the patch file to this bug report...
History
Date User Action Args
2015-04-03 17:44:00dogbert2setrecipients: + dogbert2
2015-04-03 17:44:00dogbert2setmessageid: <1428083040.47.0.668729418368.issue23860@psf.upfronthosting.co.za>
2015-04-03 17:44:00dogbert2linkissue23860 messages
2015-04-03 17:44:00dogbert2create