On Wed, Jan 09, 2008 at 09:11:21PM -0800, Neal Norwitz wrote:
> For mmapmodule.c, fd should be checked for -1 before calling stat on line 
> 1064.

On looking at this, it doesn't seem like an actual problem.  fstat(-1,
...) returns a -1 and errno is set to EBADF, 'bad file descriptor'.

        /* on OpenVMS we must ensure that all bytes are written to the file */
        fsync(fd);
#  endif
        if (fstat(fd, &st) == 0 && S_ISREG(st.st_mode)) {
             ...

In rev. 59888, I've added 'fd != -1' to the 'if' just to save a
pointless fstat() call, and made the OpenVMS fsync() call similarly
conditional, but I don't think this item is a bug, much less a
security bug.  I won't bother backporting this to 25-maint, unless
asked to do so by the 2.5 maintainer.

--amk
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to