summaryrefslogtreecommitdiffstats
path: root/Include/fileobject.h
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-08-28 15:51:43 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-08-28 15:51:43 (GMT)
commitaa26b275034c07784c4d64e9a2bc26c742577327 (patch)
treed331c0e5f2dd0fc0f754ffebaf9ebb9e5c4f7958 /Include/fileobject.h
parent524148ad7a3e5420abf867b1e30017b5ca2311a4 (diff)
downloadcpython-aa26b275034c07784c4d64e9a2bc26c742577327.zip
cpython-aa26b275034c07784c4d64e9a2bc26c742577327.tar.gz
cpython-aa26b275034c07784c4d64e9a2bc26c742577327.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.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Include/fileobject.h b/Include/fileobject.h
index c4a2a2b..a99c94d 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