[New-bugs-announce] [issue15263] Guard against invalid file handles in os functions

Larry Hastings report at bugs.python.org
Fri Jul 6 16:16:36 CEST 2012


New submission from Larry Hastings <larry at hastings.org>:

#15261 shows us that Windows can crash if you pass in an invalid file handle to Windows POSIX-y functions.  We should ensure that functions which accept path-as-an-int-fd guard against this where necessary.

I propose a macro, something like

#ifdef MS_WINDOWS
#define FD_GUARD(fd) (_PyVerify_fd(fd) ? (fd) : INVALID_HANDLE_VALUE)
#else
#define FD_GUARD(fd) (fd)
#endif

----------
assignee: larry
components: Library (Lib)
messages: 164722
nosy: amaury.forgeotdarc, larry, sbt
priority: normal
severity: normal
stage: needs patch
status: open
title: Guard against invalid file handles in os functions
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15263>
_______________________________________


More information about the New-bugs-announce mailing list