mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eugene Petrenko (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SSHD-629) java.lang.IllegalStateException: Bad item length: 89430
Date Mon, 25 Jan 2016 09:46:39 GMT
Eugene Petrenko created SSHD-629:
------------------------------------

             Summary: java.lang.IllegalStateException: Bad item length: 89430
                 Key: SSHD-629
                 URL: https://issues.apache.org/jira/browse/SSHD-629
             Project: MINA SSHD
          Issue Type: Bug
            Reporter: Eugene Petrenko


I updated default properties of the server to set default packet length to be 4mb. Via code
like that
```
      mySSHD.getProperties().put(FactoryManager.MAX_PACKET_SIZE, 4 * MB);
```

Next we connected it to jsch ssh client, that was able to increase send buffer size beyond
64kb limit. This makes an assert in AbstractChannel.java to fail.
>From the code I see the buffer size is compared to ByteArrayBuffer.MAX_LEN which is 64k.
```
        int len = buffer.getInt();
        if (len < 0 || len > ByteArrayBuffer.MAX_LEN) {
            throw new IllegalStateException("Bad item length: " + len);
        }
```

Actual exception I received in my code was
```java.lang.IllegalStateException: Bad item length: 89430
    at org.apache.sshd.common.channel.AbstractChannel.handleData(AbstractChannel.java:314)
    at org.apache.sshd.common.session.AbstractConnectionService.channelData(AbstractConnectionService.java:262)
    at org.apache.sshd.common.session.AbstractConnectionService.process(AbstractConnectionService.java:197)
    at org.apache.sshd.common.session.AbstractSession.doHandleMessage(AbstractSession.java:401)
    at org.apache.sshd.common.session.AbstractSession.handleMessage(AbstractSession.java:349)
    at org.apache.sshd.common.session.AbstractSession.decode(AbstractSession.java:848)
    at org.apache.sshd.common.session.AbstractSession.messageReceived(AbstractSession.java:331)
 <...>
 ```
Let's either deny setting packet size too bit or allow it to be used in the code




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message