commit | 487fd2e0435db0326a60821bcc96e56fa2eee711 | [log] [tgz] |
---|---|---|
author | David Reiss <dreiss@apache.org> | Tue Mar 09 05:19:11 2010 +0000 |
committer | David Reiss <dreiss@apache.org> | Tue Mar 09 05:19:11 2010 +0000 |
tree | c27ba642e688b704c41aceea37e584757d64c349 | |
parent | 4dd7801e90fe10a6614890f3d176716582b04233 [diff] |
THRIFT-657. java: Detect negative length in TBinaryProtocol git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920658 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java b/lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java index 83c85e1..16c7567 100644 --- a/lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java +++ b/lib/java/src/org/apache/thrift/protocol/TBinaryProtocol.java
@@ -365,6 +365,9 @@ } protected void checkReadLength(int length) throws TException { + if (length < 0) { + throw new TException("Negative length: " + length); + } if (checkReadLength_) { readLength_ -= length; if (readLength_ < 0) {