Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
greater than FD_SETSIZE.
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 @@
#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