Merge pull request #1457 from arodland/forgiving-ctcp

Be forgiving of a missing ending CTCP delimiter in a truncated message
This commit is contained in:
Andrew Rodland 2021-05-23 22:19:28 -04:00 committed by GitHub
parent 7121bb6e82
commit 076b2c1c73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1259,10 +1259,13 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
text++; text++;
} }
len = strlen (text); len = strlen (text);
if (text[0] == 1 && text[len - 1] == 1) /* ctcp */ if (text[0] == 1) /* ctcp */
{ {
char *new_pdibuf = NULL; char *new_pdibuf = NULL;
text[len - 1] = 0; if (text[len - 1] == 1)
{
text[len - 1] = 0;
}
text++; text++;
if (g_ascii_strncasecmp (text, "ACTION", 6) != 0) if (g_ascii_strncasecmp (text, "ACTION", 6) != 0)
flood_check (nick, ip, serv, sess, 0); flood_check (nick, ip, serv, sess, 0);