Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-13443

V5 protocol flags decoding broken

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Fix Version/s: 3.11.0, 4.0
    • Component/s: None
    • Labels:
      None
    • Severity:
      Low

      Description

      Since native protocol version 5 we deserialize the flags in org.apache.cassandra.cql3.QueryOptions.Codec#decode as follows:

                  EnumSet<Flag> flags = Flag.deserialize(version.isGreaterOrEqualTo(ProtocolVersion.V5)
                                                         ? (int)body.readUnsignedInt()
                                                         : (int)body.readByte());
      

      This works until the highest bit (0x80) is not used. readByte must be changed to readUnsignedByte.

        Attachments

          Activity

            People

            • Assignee:
              snazy Robert Stupp
              Reporter:
              snazy Robert Stupp
              Authors:
              Robert Stupp
              Reviewers:
              Stefania
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: