From c1cddb36c0c36fa099e406437966f7dbecb30dda Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sat, 3 Nov 2012 00:49:10 +0100 Subject: [PATCH] starttls: Don't corrupt the FD hash. Altering localClient->F without updating the FD hash leaves the struct Client in the FD hash indefinitely which causes a crash later if the struct is reused for a remote client. It also prevents error messages from ssld showing up on IRC properly. --- modules/m_starttls.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/m_starttls.c b/modules/m_starttls.c index b976f794..346446fc 100644 --- a/modules/m_starttls.c +++ b/modules/m_starttls.c @@ -69,7 +69,9 @@ mr_starttls(struct Client *client_p, struct Client *source_p, int parc, const ch ctl = start_ssld_accept(client_p->localClient->F, F[1], rb_get_fd(F[0])); if (ctl != NULL) { + del_from_cli_fd_hash(client_p); client_p->localClient->F = F[0]; + add_to_cli_fd_hash(client_p); client_p->localClient->ssl_ctl = ctl; SetSSL(client_p); }