You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Hudson (Commented) (JIRA)" <ji...@apache.org> on 2011/09/27 00:31:13 UTC

[jira] [Commented] (THRIFT-1365) TupleProtocol#writeBitSet unintentionally writes a variable length byte array

    [ https://issues.apache.org/jira/browse/THRIFT-1365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114981#comment-13114981 ] 

Hudson commented on THRIFT-1365:
--------------------------------

Integrated in Thrift #282 (See [https://builds.apache.org/job/Thrift/282/])
    THRIFT-1365. java: TupleProtocol#writeBitSet unintentionally writes a variable length byte array

bryanduxbury : http://svn.apache.org/viewvc/?view=rev&rev=1176072
Files : 
* /thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
* /thrift/trunk/lib/java/src/org/apache/thrift/protocol/TTupleProtocol.java
* /thrift/trunk/lib/java/test/org/apache/thrift/protocol/TestTTupleProtocol.java
* /thrift/trunk/test/DebugProtoTest.thrift

                
> TupleProtocol#writeBitSet unintentionally writes a variable length byte array
> -----------------------------------------------------------------------------
>
>                 Key: THRIFT-1365
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1365
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Compiler, Java - Library
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.8
>
>         Attachments: thrift-1365.patch
>
>
> BitSet.length() only returns the highest-set-bit, meaning that if you have more than 8 optional fields, and the 9+th optional field is unset, then only the first byte's worth of bits will be serialized. This leads to a problem on the read side, where the bit vector is assumed to be fixed width, and arbitrary deserialization occurs.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira