Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is

greater than FD_SETSIZE.
This commit is contained in:
Charles-François Natali 2011-08-28 17:51:43 +02:00
parent 524148ad7a
commit aa26b27503
6 changed files with 21 additions and 19 deletions

View file

@ -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