From f98b77c4a2c9d7b230dc69835c1fbfa8fcc55dda Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 27 Jun 2001 21:26:33 +0000 Subject: [PATCH] Don't reply to CTCP PINGs longer than 100 bytes (see the comment). git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1578 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/ctcp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/irc/core/ctcp.c b/src/irc/core/ctcp.c index 917a9903..88261800 100644 --- a/src/irc/core/ctcp.c +++ b/src/irc/core/ctcp.c @@ -73,6 +73,21 @@ static void ctcp_ping(IRC_SERVER_REC *server, const char *data, g_return_if_fail(server != NULL); g_return_if_fail(nick != NULL); + if (strlen(data) > 100) { + /* Yes, this is kind of a kludge, but people who PING you + with messages this long deserve not to get the reply. + + The problem with long messages is that when you send lots + of data to server, it's input buffer gets full and you get + killed from server because of "excess flood". + + Irssi's current flood protection doesn't count the message + length, but even if it did, the CTCP flooder would still + be able to at least slow down your possibility to send + messages to server. */ + return; + } + str = g_strdup_printf("NOTICE %s :\001PING %s\001", nick, data); ctcp_send_reply(server, str); g_free(str);