Repository: thrift
Updated Branches:
  refs/heads/master fe5330955 -> 53349926e


THRIFT-3407 Refill buffer when JSON closing bracket is missing

This closes #678


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/53349926
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/53349926
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/53349926

Branch: refs/heads/master
Commit: 53349926e00b02c80d3f3bc1e0eb2981d96ba5dd
Parents: fe53309
Author: Nobuaki Sukegawa <[email protected]>
Authored: Tue Nov 3 22:58:20 2015 +0900
Committer: Nobuaki Sukegawa <[email protected]>
Committed: Thu Nov 5 00:10:27 2015 +0900

----------------------------------------------------------------------
 lib/nodejs/lib/thrift/json_protocol.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/53349926/lib/nodejs/lib/thrift/json_protocol.js
----------------------------------------------------------------------
diff --git a/lib/nodejs/lib/thrift/json_protocol.js 
b/lib/nodejs/lib/thrift/json_protocol.js
index e98650c..18fb012 100644
--- a/lib/nodejs/lib/thrift/json_protocol.js
+++ b/lib/nodejs/lib/thrift/json_protocol.js
@@ -418,7 +418,8 @@ TJSONProtocol.prototype.readMessageBegin = function() {
   }
 
   if (openBracketCount !== 0) {
-    throw new Error("Malformed JSON input, mismatched backets");
+    // Missing closing bracket. Can be buffer underrun.
+    throw new InputBufferUnderrunError();
   }
 
   //Reconstitute the JSON object and conume the necessary bytes

Reply via email to