diff options
author | Charles-François Natali <neologix@free.fr> | 2011-08-28 17:51:43 +0200 |
---|---|---|
committer | Charles-François Natali <neologix@free.fr> | 2011-08-28 17:51:43 +0200 |
commit | 1fa4d5cbe6e674294c63d8162deecdaf7e0654a5 (patch) | |
tree | baaf15f119cd785843f588220d17d3ad3bfaef02 /Include/fileobject.h | |
parent | 5b1f95f6f7fa544629a14b3363211563594a3fad (diff) | |
download | cpython-1fa4d5cbe6e674294c63d8162deecdaf7e0654a5.tar.gz |
Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
greater than FD_SETSIZE.
Diffstat (limited to 'Include/fileobject.h')
-rw-r--r-- | Include/fileobject.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Include/fileobject.h b/Include/fileobject.h index c4a2a2bb15..a99c94d2d5 100644 --- a/Include/fileobject.h +++ b/Include/fileobject.h @@ -44,6 +44,13 @@ int _PyVerify_fd(int fd); #endif #endif /* Py_LIMITED_API */ +/* A routine to check if a file descriptor can be select()-ed. */ +#ifdef HAVE_SELECT + #define _PyIsSelectable_fd(FD) (((FD) >= 0) && ((FD) < FD_SETSIZE)) +#else + #define _PyIsSelectable_fd(FD) (1) +#endif /* HAVE_SELECT */ + #ifdef __cplusplus } #endif |