From cfd0163a5b74e6c198d0bcb4a742492111e8aeae Mon Sep 17 00:00:00 2001 From: Michael Santos Date: Sun, 17 Jun 2018 10:01:44 -0400 Subject: [PATCH] main_loop: initialize in_socket in_socket may be used uninitialized if no addresses are available. ~~~ sslh-select.c:415:8: warning: Function call argument is an uninitialized value check_access_rights(in_socket, cnx[i].proto->service)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ --- sslh-select.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sslh-select.c b/sslh-select.c index 2fa83fe..07265e3 100644 --- a/sslh-select.c +++ b/sslh-select.c @@ -301,7 +301,8 @@ void main_loop(int listen_sockets[], int num_addr_listen) fd_set fds_r, fds_w; /* reference fd sets (used to init the next 2) */ fd_set readfds, writefds; /* working read and write fd sets */ struct timeval tv; - int max_fd, in_socket, i, j, res; + int max_fd, i, j, res; + int in_socket = 0; struct connection *cnx; int num_cnx; /* Number of connections in *cnx */ int num_probing = 0; /* Number of connections currently probing