switch (errno) {
case EINPROGRESS:
+
+ if (fd < 0 || fd >= FD_SETSIZE) {
+ errno = EBADF;
+ goto error_out;
+ }
+
FD_ZERO(&w_fds);
FD_SET(fd, &w_fds);
tv.tv_sec = CONNECT_TIMEOUT - wait_time;
struct timeval tv;
fd_set r_fds;
+ if (winbindd_fd < 0 || winbindd_fd >= FD_SETSIZE) {
+ errno = EBADF;
+ winbind_close_sock();
+ return -1;
+ }
+
/* Catch pipe close on other end by checking if a read()
call would not block by calling select(). */
struct timeval tv;
fd_set r_fds;
+ if (winbindd_fd < 0 || winbindd_fd >= FD_SETSIZE) {
+ errno = EBADF;
+ winbind_close_sock();
+ return -1;
+ }
/* Catch pipe close on other end by checking if a read()
call would not block by calling select(). */