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 c4a2a2b..a99c94d 100644
--- a/Include/fileobject.h
+++ b/Include/fileobject.h
@@ -44,6 +44,13 @@
 #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