summaryrefslogtreecommitdiff
path: root/Include/fileobject.h
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-08-28 17:51:43 +0200
committerCharles-François Natali <neologix@free.fr>2011-08-28 17:51:43 +0200
commit1fa4d5cbe6e674294c63d8162deecdaf7e0654a5 (patch)
treebaaf15f119cd785843f588220d17d3ad3bfaef02 /Include/fileobject.h
parent5b1f95f6f7fa544629a14b3363211563594a3fad (diff)
downloadcpython-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.h7
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