[
https://issues.apache.org/jira/browse/ZOOKEEPER-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Enrico Olivelli resolved ZOOKEEPER-4281.
----------------------------------------
Fix Version/s: 3.7.1
3.8.0
Resolution: Fixed
Issue resolved by pull request 1683
[https://github.com/apache/zookeeper/pull/1683]
> 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
> Priority: Major
> Labels: pull-request-available
> Fix For: 3.8.0, 3.7.1
>
> Time Spent: 2h 10m
> Remaining Estimate: 0h
>
>
> 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)