[
https://issues.apache.org/jira/browse/ZOOKEEPER-4281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17320451#comment-17320451
]
Huizhi Lu edited comment on ZOOKEEPER-4281 at 4/13/21, 6:34 PM:
----------------------------------------------------------------
[~ddiederen] [~eolivelli] [~maoling] Could you help take a look? Thanks.
was (Author: hzlu):
[~ztzg],[~eolivelli], [~maoling] Could you help take a look? Thanks.
> 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
>
>
> 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)