From 6b8ba23c805527aaa8bb5b27d358ebc57cd4028f Mon Sep 17 00:00:00 2001 From: deuce <> Date: Fri, 15 Jan 2016 11:44:22 +0000 Subject: [PATCH] Don't call auth_cb() if it's undefined, parse remote addresses in try/catch. --- exec/load/binkp.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/exec/load/binkp.js b/exec/load/binkp.js index 4ea053535d..34156e04c0 100644 --- a/exec/load/binkp.js +++ b/exec/load/binkp.js @@ -209,7 +209,6 @@ BinkP.prototype.connect = function(addr, password, auth_cb, port) if (password === undefined) password = '-'; - if (port === undefined) port = 24554; @@ -254,7 +253,8 @@ BinkP.prototype.connect = function(addr, password, auth_cb, port) return false; } - auth_cb(this.authenticated, this); + if (auth_cb !== undefined) + auth_cb(this.authenticated, this); if (js.terminated) { this.close(); @@ -702,7 +702,11 @@ BinkP.prototype.recvFrame = function(timeout) else { this.remote_addrs = []; ret.data.split(/ /).forEach(function(addr) { - this.remote_addrs.push(FIDO.parse_addr(addr, this.default_zone)); + try { + this.remote_addrs.push(FIDO.parse_addr(addr, this.default_zone)); + } + catch (e) { + } }, this); } break; -- GitLab