Thrift
  1. Thrift
  2. THRIFT-1365

TupleProtocol#writeBitSet unintentionally writes a variable length byte array

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8
    • Labels:
      None

      Description

      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.

      1. thrift-1365.patch
        4 kB
        Bryan Duxbury

        Activity

        Hide
        Hudson added a comment -

        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
        Show
        Hudson added a comment - 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
        Hide
        Bryan Duxbury added a comment -

        This patch includes a test and fixes to the library and the compiler.

        Show
        Bryan Duxbury added a comment - This patch includes a test and fixes to the library and the compiler.

          People

          • Assignee:
            Bryan Duxbury
            Reporter:
            Bryan Duxbury
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development