From 5281e9d3e788da94c7c30fc664ea007e0ddaeb71 Mon Sep 17 00:00:00 2001 From: cvlchinet Date: Thu, 13 Nov 2014 17:37:50 +0100 Subject: [PATCH] Fix TSimpleJSONProtocol reading beyond message TSimpleJSONProtocol should stop reading after whole message was read. This is a more simple fix than https://github.com/apache/thrift/pull/134 --- lib/go/thrift/simple_json_protocol.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/go/thrift/simple_json_protocol.go b/lib/go/thrift/simple_json_protocol.go index 71598acbbb6..41cfff2ac29 100644 --- a/lib/go/thrift/simple_json_protocol.go +++ b/lib/go/thrift/simple_json_protocol.go @@ -1038,6 +1038,9 @@ func (p *TSimpleJSONProtocol) ParseListEnd() error { } } p.parseContextStack = p.parseContextStack[:len(p.parseContextStack)-1] + if _ParseContext(p.parseContextStack[len(p.parseContextStack)-1]) == _CONTEXT_IN_TOPLEVEL { + return nil + } return p.ParsePostValue() }