mirror of
https://github.com/samhocevar/rinetd.git
synced 2025-01-28 05:10:07 +08:00
Fix a probably harmless uninitialised memory access.
This commit is contained in:
parent
c92c0cf4bb
commit
a259a67e2d
17
rinetd.c
17
rinetd.c
@ -605,14 +605,6 @@ static void selectPass(void) {
|
||||
}
|
||||
}
|
||||
select(maxfd + 1, readfds, writefds, 0, 0);
|
||||
for (int i = 0; i < seTotal; ++i) {
|
||||
ServerInfo *srv = &seInfo[i];
|
||||
if (srv->fd != INVALID_SOCKET) {
|
||||
if (FD_ISSET_EXT(srv->fd, readfds)) {
|
||||
handleAccept(srv);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < coTotal; ++i) {
|
||||
ConnectionInfo *cnx = &coInfo[i];
|
||||
if (cnx->remote.fd != INVALID_SOCKET) {
|
||||
@ -636,6 +628,15 @@ static void selectPass(void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Handle servers last because handleAccept() may modify coTotal */
|
||||
for (int i = 0; i < seTotal; ++i) {
|
||||
ServerInfo *srv = &seInfo[i];
|
||||
if (srv->fd != INVALID_SOCKET) {
|
||||
if (FD_ISSET_EXT(srv->fd, readfds)) {
|
||||
handleAccept(srv);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void handleRead(ConnectionInfo *cnx, Socket *socket, Socket *other_socket)
|
||||
|
Loading…
Reference in New Issue
Block a user