From c969315f1dc96fb554306eee4d177d9c5484f33d Mon Sep 17 00:00:00 2001 From: "gijskruitbosch%gmail.com" Date: Sun, 12 Feb 2006 08:26:39 +0000 Subject: [PATCH] Bug 326523 - Reject blatantly invalid CTCP Ping responses ChatZilla Only. p=rdmsoft@bugs.rdmsoft.com (Robert Marshall) r=samuel --- extensions/irc/xul/content/handlers.js | 8 ++++++++ extensions/irc/xul/locale/en-US/chatzilla.properties | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/extensions/irc/xul/content/handlers.js b/extensions/irc/xul/content/handlers.js index 54cda18eb06d..48fa6d533a36 100644 --- a/extensions/irc/xul/content/handlers.js +++ b/extensions/irc/xul/content/handlers.js @@ -1918,6 +1918,14 @@ function my_netdisconnect (e) CIRCNetwork.prototype.onCTCPReplyPing = function my_replyping (e) { + // see bug 326523 + if (e.CTCPData.length != 13) + { + this.display(getMsg(MSG_PING_REPLY_INVALID, e.user.unicodeName), + "INFO", e.user, "ME!"); + return; + } + var delay = formatDateOffset((new Date() - new Date(Number(e.CTCPData))) / 1000); this.display(getMsg(MSG_PING_REPLY, [e.user.unicodeName, delay]), "INFO", diff --git a/extensions/irc/xul/locale/en-US/chatzilla.properties b/extensions/irc/xul/locale/en-US/chatzilla.properties index 12c13238624a..694d40857c8e 100644 --- a/extensions/irc/xul/locale/en-US/chatzilla.properties +++ b/extensions/irc/xul/locale/en-US/chatzilla.properties @@ -1148,8 +1148,9 @@ msg.confirm.disconnect.all = Are you sure you want to disconnect from ALL networ msg.no.connected.nets = You are not connected to any networks. msg.no.reconnectable.nets = There are no networks to reconnect to. -msg.ping.reply = Ping reply from %S in %S" -msg.prefix.response = "%S, your result is, +msg.ping.reply = Ping reply from %S in %S. +msg.ping.reply.invalid = Malformed ping reply from %S. +msg.prefix.response = "%S, your result is, msg.topic.changed = "%S has changed the topic to ``%S'' msg.topic = Topic for %S is ``%S''