From 6388eda6834f4f355b17f550c98d83d3d6d20191 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Tue, 12 May 2009 23:18:41 +0200 Subject: [PATCH] Report errors and close the incoming connection if socketpair fails for ssl connections. from ircd-ratbox (r26503) (androsyn) --- src/listener.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/listener.c b/src/listener.c index 7f270a15..9e03c12d 100644 --- a/src/listener.c +++ b/src/listener.c @@ -552,7 +552,12 @@ accept_ssld(rb_fde_t *F, struct sockaddr *addr, struct sockaddr *laddr, struct L { ssl_ctl_t *ctl; rb_fde_t *xF[2]; - rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF[0], &xF[1], "Incoming ssld Connection"); + if(rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF[0], &xF[1], "Incoming ssld Connection") == -1) + { + ilog_error("creating SSL/TLS socket pairs"); + rb_close(F); + return; + } ctl = start_ssld_accept(F, xF[1], rb_get_fd(xF[0])); /* this will close F for us */ add_connection(listener, xF[0], addr, laddr, ctl); }