-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
THRIFT-5294: Fix panic in go TSimpleJSONProtocol
Client: go In go library's TSimpleJSONProtocol and TJSONProtocol implementations, we use slices as stacks for context info, but didn't do proper boundary check when peeking/popping, result in it might panic with using -1 as slice index in certain cases of calling Write*End without matching Write*Begin before. Refactor the code to properly implement the stack, and return a TProtocolException instead on those cases. Also add unit tests for all protocols. The unit tests shown that TCompactProtocol.[Read|Write]StructEnd would also panic with unmatched Begin calls, so fix them as well.
- Loading branch information
Showing
6 changed files
with
261 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.