diff --git a/changelog b/changelog index 557392c7..60b25546 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +Sat Oct 12 18:24 2013 CDT + * lib/user.js: Fix bad chatMsg packet causing exceptions + Sat Oct 12 15:53 2013 CDT * lib/channel.js: Add a try-catch to playlist loading to catch the mysterious error that's been coming up (corrupt pl?) diff --git a/lib/user.js b/lib/user.js index e949e7e2..cff835f7 100644 --- a/lib/user.js +++ b/lib/user.js @@ -229,6 +229,13 @@ User.prototype.initCallbacks = function () { self.socket.on("chatMsg", function (data) { if (self.inChannel()) { + if (typeof data.msg !== "string") { + self.socket.emit("kick", { + reason: "Invalid chatMsg packet!" + }); + self.socket.disconnect(true); + return; + } if (data.msg.indexOf("/afk") !== 0) { self.setAFK(false); self.autoAFK();