You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "sumit agrawal (JIRA)" <ji...@apache.org> on 2018/04/03 05:21:00 UTC

[jira] [Created] (ZOOKEEPER-3016) Observers QuorumCnxManager thread died due to incorrect client packet

sumit agrawal created ZOOKEEPER-3016:
----------------------------------------

             Summary: Observers QuorumCnxManager thread died due to incorrect client packet
                 Key: ZOOKEEPER-3016
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3016
             Project: ZooKeeper
          Issue Type: Bug
    Affects Versions: 3.4.6
            Reporter: sumit agrawal


While accepting connection from client, and message is incorrect, this causes NegativeArraySizeException while creating byte array of negative size.

 

~2018-03-02 23:51:21 [UTC:20180302T235121+0100]|INFO ||/xx.xx.xx.xx:3888hread|Coordination > Received connection request /yy.yy.yy.yy:18320 (QuorumCnxManager.java:511)~

~2018-03-02 23:51:21 [UTC:20180302T235121+0100]|ERROR||/xx.xx.xx.xx:3888hread|Coordination > Thread Thread[/xx.xx.xx.xx:3888,5,main] died (NIOServerCnxnFactory.java:44)~
~java.lang.NegativeArraySizeException~
 ~at org.apache.zookeeper.server.quorum.QuorumCnxManager.receiveConnection(QuorumCnxManager.java:242)~
 ~at org.apache.zookeeper.server.quorum.QuorumCnxManager$Listener.run(QuorumCnxManager.java:513)~

 

Below is code reference having the issue.

int num_remaining_bytes = din.readInt();
 byte[] b = new byte[num_remaining_bytes];

 

Check for invalid input must be present to avoid Observer crashing.

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)