summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--functions.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/functions.c b/functions.c
index 3dd8045..a8f0927 100644
--- a/functions.c
+++ b/functions.c
@@ -425,6 +425,10 @@ int sendtoclient(int fd, char *strsrc, struct client *clients, struct settings *
break;
}
}
+ if (i == MAXCLIENTS ) {
+ debugprint(DEBUG_CRIT, "error: sendtoclient() client fd %d not found in clients array, returning 0.\n", fd);
+ return 0;
+ }
debugprint(DEBUG_SOME, "sendtoclient(): sending \"%s\" (length %zd) to client with fd %d.\n", str, strlen(str), fd);
if (socksend(clients[i].ssl, str, strlen(str), settings->clienttls) == -1) {