Huizhi Lu created ZOOKEEPER-4281:
------------------------------------

             Summary: Packet length sanity check is inconsistent
                 Key: ZOOKEEPER-4281
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4281
             Project: ZooKeeper
          Issue Type: Improvement
            Reporter: Huizhi Lu
            Assignee: Huizhi Lu


 

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.
{code:java}
if (len < 0 || len >= packetLen) {
    throw new IOException("Packet len " + len + " is out of range!");
}
{code}
 

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

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to