Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
0.9.9
-
None
Description
The description of this issue was copied from GUAC-1477, an issue in the JIRA instance used by the Guacamole project prior to its acceptance into the Apache Incubator.
Comments, attachments, related issues, and history from prior to acceptance have not been copied and can be found instead at the original issue.
In socket_fd.c, in function __guac_socket_fd_select_handler(), select() will be invoked without initializing the corresponding fd_set if usec_timeout is less than zero:
/* No timeout if usec_timeout is negative */ if (usec_timeout < 0) retval = select(data->fd + 1, &fds, NULL, NULL, NULL); /* Handle timeout if specified */ else { timeout.tv_sec = usec_timeout/1000000; timeout.tv_usec = usec_timeout%1000000; FD_ZERO(&fds); FD_SET(data->fd, &fds); retval = select(data->fd + 1, &fds, NULL, NULL, &timeout); }
Without the required FD_ZERO() and FD_SET() calls, select() will block indefinitely because no fd has been registered.