Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-4281

Packet length sanity check is inconsistent

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.8.0, 3.7.1
    • None

    Description

       

      There are sanity checks for packet size when deserializing a packet. One place has the inclusion: len >= packetLen. ** It rejects to deserialize the bytes that are exactly sized jute.maxbuffer. It's confusing. This check should use ">" so the maxbuffer length packet can still be deserialized, like the other checks.

      if (len < 0 || len >= packetLen) {
          throw new IOException("Packet len " + len + " is out of range!");
      }
      

       

       

      if (len < 0 || len > BinaryInputArchive.maxBuffer) {
          throw new IOException("Len error " + len);
      }
      

       

       

      Attachments

        Activity

          People

            hzlu Huizhi Lu
            hzlu Huizhi Lu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 20m
                2h 20m