jiang1308061292 opened a new issue, #300:
URL: https://github.com/apache/mina-sshd/issues/300

   ### Version
   
   2.9.2
   
   ### Bug description
   
   The remote side then decides whether it can open the channel, and responds 
with either SSH_MSG_CHANNEL_OPEN_CONFIRMATION or SSH_MSG_CHANNEL_OPEN_FAILURE.
         byte      SSH_MSG_CHANNEL_OPEN_CONFIRMATION
         uint32    recipient channel
         uint32    sender channel
         uint32    initial window size
         uint32    maximum packet size
         ....      channel type specific data follows
   
   the sender is uint32,but the variable sender of channelOpenConfirmation is 
int. if sender is more than 2147483647, the variable sender of 
channelOpenConfirmation will be negative and cause the 
IllegalArgumentException: Invalid UINT32.
   
   
   ### Actual behavior
   
   if the buffer related to sender is -128 1 0 1, the sender will be 
-2147418111 and it cause cause the IllegalArgumentException: Invalid UINT32.
   
   ### Expected behavior
   
   if sender is more than 2147483647,it Shouldn't cause the 
IllegalArgumentException: Invalid UINT32.
   
   ### Relevant log output
   
   ```Shell
   IllegalArgumentException: Invalid UINT32 value: -2147418111 
   java.lang.IllegalArgumentException: Invalid UINT32 value: -2147418111
        at 
org.apache.sshd.common.util.ValidateUtils.createFormattedException(ValidateUtils.java:213)
 ~[sshd-common-2.9.2-h0.gdd.pub.r1.jar:2.9.2-h0.gdd.pub.r1]
        at 
org.apache.sshd.common.util.ValidateUtils.throwIllegalArgumentException(ValidateUtils.java:179)
 ~[sshd-common-2.9.2-h0.gdd.pub.r1.jar:2.9.2-h0.gdd.pub.r1]
        at 
org.apache.sshd.common.util.ValidateUtils.checkTrue(ValidateUtils.java:162) 
~[sshd-common-2.9.2-h0.gdd.pub.r1.jar:2.9.2-h0.gdd.pub.r1]
        at 
org.apache.sshd.common.util.buffer.BufferUtils.validateUint32Value(BufferUtils.java:701)
 ~[sshd-common-2.9.2-h0.gdd.pub.r1.jar:2.9.2-h0.gdd.pub.r1]
        at org.apache.sshd.common.util.buffer.Buffer.putUInt(Buffer.java:720) 
~[sshd-common-2.9.2-h0.gdd.pub.r1.jar:2.9.2-h0.gdd.pub.r1]
        at 
org.apache.sshd.common.channel.ChannelAsyncOutputStream.createSendBuffer(ChannelAsyncOutputStream.java:393)
 ~[sshd-core-2.9.2-h0.gdd.pub.r1.jar:2.9.2-h0.gdd.pub.r1]
        at 
org.apache.sshd.common.channel.ChannelAsyncOutputStream.writePacket(ChannelAsyncOutputStream.java:338)
 ~[sshd-core-2.9.2-h0.gdd.pub.r1.jar:2.9.2-h0.gdd.pub.r1]
        at 
org.apache.sshd.common.channel.ChannelAsyncOutputStream.doWriteIfPossible(ChannelAsyncOutputStream.java:215)
 ~[sshd-core-2.9.2-h0.gdd.pub.r1.jar:2.9.2-h0.gdd.pub.r1]
        at 
org.apache.sshd.common.channel.ChannelAsyncOutputStream.writeBuffer(ChannelAsyncOutputStream.java:110)
 ~[sshd-core-2.9.2-h0.gdd.pub.r1.jar:2.9.2-h0.gdd.pub.r1]
        at 
org.apache.sshd.common.forward.DefaultForwarder$StaticIoHandler.lambda$messageReceived$2(DefaultForwarder.java:1063)
 ~[sshd-core-2.9.2-h0.gdd.pub.r1.jar:2.9.2-h0.gdd.pub.r1]
        at 
org.apache.sshd.common.util.threads.ThreadUtils.runAsInternal(ThreadUtils.java:68)
 ~[sshd-common-2.9.2-h0.gdd.pub.r1.jar:2.9.2-h0.gdd.pub.r1]
        at 
org.apache.sshd.common.forward.DefaultForwarder$StaticIoHandler.messageReceived(DefaultForwarder.java:1063)
 ~[sshd-core-2.9.2-h0.gdd.pub.r1.jar:2.9.2-h0.gdd.pub.r1]
        at 
org.apache.sshd.mina.MinaService.messageReceived(MinaService.java:156) 
~[sshd-mina-2.9.2.jar:2.9.2]
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:1015)
 ~[mina-core-2.1.6.jar:?]
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650)
 ~[mina-core-2.1.6.jar:?]
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:49)
 ~[mina-core-2.1.6.jar:?]
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1128)
 ~[mina-core-2.1.6.jar:?]
        at 
org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:122)
 ~[mina-core-2.1.6.jar:?]
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650)
 ~[mina-core-2.1.6.jar:?]
        at 
org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:643)
 ~[mina-core-2.1.6.jar:?]
        at 
org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:539)
 ~[mina-core-2.1.6.jar:?]
        at 
org.apache.mina.core.polling.AbstractPollingIoProcessor.access$1200(AbstractPollingIoProcessor.java:68)
 ~[mina-core-2.1.6.jar:?]
        at 
org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.process(AbstractPollingIoProcessor.java:1224)
 ~[mina-core-2.1.6.jar:?]
        at 
org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.process(AbstractPollingIoProcessor.java:1213)
 ~[mina-core-2.1.6.jar:?]
        at 
org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:683)
 ~[mina-core-2.1.6.jar:?]
        at 
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) 
~[mina-core-2.1.6.jar:?]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
~[?:1.8.0_352]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
~[?:1.8.0_352]
        at java.lang.Thread.run(Thread.java:750) ~[?:1.8.0_352]
   ```
   
   
   ### Other information
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to