From d5d3ffcfe735bfda5d3bb9295b202fa255d3b1cb Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Tue, 19 Jan 2016 10:51:41 +0000
Subject: [PATCH] Treat NULLs "as end-of-line" per FTS-1026

---
 exec/load/binkp.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/exec/load/binkp.js b/exec/load/binkp.js
index fcdc08261a..702ed73246 100644
--- a/exec/load/binkp.js
+++ b/exec/load/binkp.js
@@ -645,6 +645,7 @@ BinkP.prototype.recvFrame = function(timeout)
 	var tmp;
 	var ver;
 	var avail;
+	var nullpos;
 
 	// Avoid warning from syncjslint by putting this in a closure.
 	function hex2ascii(hex)
@@ -715,6 +716,9 @@ BinkP.prototype.recvFrame = function(timeout)
 				log(LOG_DEBUG, "Got data frame length "+ret.length);
 		}
 		if (ret.is_cmd) {
+			nullpos = ret.data.indexOf(ascii(0));
+			if (nullpos > -1)
+				ret.data = ret.data.substr(0, nullpos);
 			switch(ret.command) {
 				case this.command.M_ERR:
 					log(LOG_ERROR, "BinkP got fatal error from remote: '"+ret.data+"'.");
-- 
GitLab