diff options
author | Charles-François Natali <neologix@free.fr> | 2011-08-28 14:22:33 (GMT) |
---|---|---|
committer | Charles-François Natali <neologix@free.fr> | 2011-08-28 14:22:33 (GMT) |
commit | fda7b379acde3ad60bbd42acb6da7e7099d25133 (patch) | |
tree | 8a6f41e799670ac5cea353e6cc4bc671fec25798 /Include/fileobject.h | |
parent | bbabbae114f6d16dacdc1ad8f6f04b95fb6b17eb (diff) | |
download | cpython-fda7b379acde3ad60bbd42acb6da7e7099d25133.zip cpython-fda7b379acde3ad60bbd42acb6da7e7099d25133.tar.gz cpython-fda7b379acde3ad60bbd42acb6da7e7099d25133.tar.bz2 |
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 | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Include/fileobject.h b/Include/fileobject.h index ba506ec..86ade5a 100644 --- a/Include/fileobject.h +++ b/Include/fileobject.h @@ -84,6 +84,15 @@ int _PyVerify_fd(int fd); #define _PyVerify_fd(A) (1) /* dummy */ #endif +#ifdef HAVE_SELECT +/* A routine to check if a file descriptor can be select()-ed. */ +#ifdef Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE + #define _PyIsSelectable_fd(FD) (1) +#else + #define _PyIsSelectable_fd(FD) (((FD) >= 0) && ((FD) < FD_SETSIZE)) +#endif +#endif /* HAVE_SELECT */ + #ifdef __cplusplus } #endif |