This is an automated email from the ASF dual-hosted git repository.

lgoldstein pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mina-sshd.git

commit f68a8f513a6c3be6cde0af7d8ac46d18b251ab3a
Author: Lyor Goldstein <[email protected]>
AuthorDate: Tue Jul 9 09:07:51 2019 +0300

    Fix possible confusion about commands having a high numerical value 
received while KEX not yet completed
---
 .../java/org/apache/sshd/common/session/helpers/AbstractSession.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
 
b/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
index 55f3fc7..9c6dc7e 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
@@ -799,9 +799,9 @@ public abstract class AbstractSession extends SessionHelper 
{
         // While exchanging key, queue high level packets
         if (!KexState.DONE.equals(kexState.get())) {
             byte[] bufData = buffer.array();
-            byte cmd = bufData[buffer.rpos()];
+            int cmd = bufData[buffer.rpos()] & 0xFF;
             if (cmd > SshConstants.SSH_MSG_KEX_LAST) {
-                String cmdName = SshConstants.getCommandMessageName(cmd & 
0xFF);
+                String cmdName = SshConstants.getCommandMessageName(cmd);
                 synchronized (pendingPackets) {
                     if (!KexState.DONE.equals(kexState.get())) {
                         if (pendingPackets.isEmpty()) {

Reply via email to