From c0d93064a6bf7974160b12a7be1d55ca96c8cb77 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Mon, 27 Jun 2022 21:09:35 -0500 Subject: [PATCH] chmode: Use original string when removing a mask --- ircd/chmode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ircd/chmode.c b/ircd/chmode.c index 2b9f48c5..1b812eab 100644 --- a/ircd/chmode.c +++ b/ircd/chmode.c @@ -927,7 +927,7 @@ chm_ban(struct Client *source_p, struct Channel *chptr, if (removed && removed->forward) removed_mask_pos += snprintf(buf + old_removed_mask_pos, sizeof(buf) - old_removed_mask_pos, "%s$%s", removed->banstr, removed->forward) + 1; else - removed_mask_pos += rb_strlcpy(buf + old_removed_mask_pos, mask, sizeof(buf)) + 1; + removed_mask_pos += rb_strlcpy(buf + old_removed_mask_pos, removed ? removed->banstr : mask, sizeof(buf)) + 1; if (removed) { free_ban(removed);