summaryrefslogtreecommitdiff
path: root/sockets.c
diff options
context:
space:
mode:
Diffstat (limited to 'sockets.c')
-rw-r--r--sockets.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sockets.c b/sockets.c
index f201d79..c075232 100644
--- a/sockets.c
+++ b/sockets.c
@@ -277,6 +277,10 @@ int fd_toggle_blocking(int fd, int blocking) {
int openssl_accept(int fd, struct client *clients, struct ircdstate *ircdstate, struct settings *settings, struct clientcodes *clientcodes) {
// Get the index of the this client fd
int clientindex = arrindex(clients, fd);
+ if (clientindex < 0) {
+ debugprint(DEBUG_CRIT, "openssl_accept(): error: arrindex() returned '%d', exiting!\n", clientindex);
+ exit(1);
+ }
// Clear OpenSSL errors before proceeding so we can reliably get errors from SSL_accept
ERR_clear_error();