From 6638c837cce068adbc3d3dfdef136a30443f6724 Mon Sep 17 00:00:00 2001 From: Doug Freed Date: Sat, 28 Nov 2020 20:03:29 -0500 Subject: [PATCH] send: fix infinite recursion in _send_linebuf A netwide snote eventually calls into this function again with the same server as has already been determined is over its sendq. Mark the link dead before sending the snote to avoid infinite recursion. --- ircd/send.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ircd/send.c b/ircd/send.c index da2a9c53..9d678a3d 100644 --- a/ircd/send.c +++ b/ircd/send.c @@ -70,6 +70,8 @@ _send_linebuf(struct Client *to, buf_head_t *linebuf) if(rb_linebuf_len(&to->localClient->buf_sendq) > get_sendq(to)) { + dead_link(to, 1); + if(IsServer(to)) { sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, @@ -84,7 +86,6 @@ _send_linebuf(struct Client *to, buf_head_t *linebuf) get_sendq(to)); } - dead_link(to, 1); return -1; } else