From 076b2c1c7332e82028811d92a7f7f4b091be0163 Mon Sep 17 00:00:00 2001 From: Andrew Rodland Date: Sun, 23 May 2021 22:19:28 -0400 Subject: [PATCH] Merge pull request #1457 from arodland/forgiving-ctcp Be forgiving of a missing ending CTCP delimiter in a truncated message --- src/common/proto-irc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index cfe76361..c8e44b62 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -1259,10 +1259,13 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[], text++; } len = strlen (text); - if (text[0] == 1 && text[len - 1] == 1) /* ctcp */ + if (text[0] == 1) /* ctcp */ { char *new_pdibuf = NULL; - text[len - 1] = 0; + if (text[len - 1] == 1) + { + text[len - 1] = 0; + } text++; if (g_ascii_strncasecmp (text, "ACTION", 6) != 0) flood_check (nick, ip, serv, sess, 0);