]> jfr.im git - irc/freenode/solanum.git/commitdiff
send: fix infinite recursion in _send_linebuf
authorDoug Freed <redacted>
Sun, 29 Nov 2020 01:03:29 +0000 (20:03 -0500)
committerDoug Freed <redacted>
Sun, 29 Nov 2020 01:08:46 +0000 (20:08 -0500)
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

index da2a9c53ba366ebe6f1e11ee8deebc5fdb95c037..9d678a3d0a6337b508dc5994c1cb3a01ee0dcdde 100644 (file)
@@ -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