From ae3506f97cd7bcf0e41862c8f7a82b58e179ffe6 Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Thu, 12 Jun 2014 16:29:39 +0100 Subject: [PATCH] Fix global variable leakage --- server/irc/connection.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/irc/connection.js b/server/irc/connection.js index 2017d1f..3b05870 100644 --- a/server/irc/connection.js +++ b/server/irc/connection.js @@ -319,7 +319,7 @@ IrcConnection.prototype.clientEvent = function (event_name, data, callback) { */ IrcConnection.prototype.write = function (data, force) { //ENCODE string to encoding of the server - encoded_buffer = iconv.encode(data + '\r\n', this.encoding); + var encoded_buffer = iconv.encode(data + '\r\n', this.encoding); if (force) { this.socket.write(encoded_buffer); @@ -674,6 +674,7 @@ function socketOnData(data) { var data_pos, // Current position within the data Buffer line_start = 0, lines = [], + i, line = '', max_buffer_size = 1024; // 1024 bytes is the maximum length of two RFC1459 IRC messages. // May need tweaking when IRCv3 message tags are more widespread -- 2.25.1