From 6412df1b3df28c6213b43821c4a98cc3857d9a3f Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 15 Apr 2010 07:50:39 +0000 Subject: Git update 15/4/2010 --- libxcb/src/xcb_conn.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libxcb/src/xcb_conn.c') diff --git a/libxcb/src/xcb_conn.c b/libxcb/src/xcb_conn.c index ed2153d27..1d3761452 100644 --- a/libxcb/src/xcb_conn.c +++ b/libxcb/src/xcb_conn.c @@ -210,6 +210,14 @@ xcb_connection_t *xcb_connect_to_fd(int fd, xcb_auth_info_t *auth_info) { xcb_connection_t* c; +#ifndef USE_POLL + if(fd >= FD_SETSIZE) /* would overflow in FD_SET */ + { + close(fd); + return (xcb_connection_t *) &error_connection; + } +#endif + c = calloc(1, sizeof(xcb_connection_t)); if(!c) { close(fd); -- cgit v1.2.3