Uploaded image for project: 'MINA SSHD'
  1. MINA SSHD
  2. SSHD-84

ChannelPipedInputStream.read() incorrect sign extension in result

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 0.3.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      java.io.InputStream.read() defines its result as an int in the range 0 to 255 (except EOF which is -1). But current org.apache.sshd.common.channel.ChannelPipedInputStream.read() implementation makes sign extension for byte values greater than 127 (by `return b[0]`). This should be fixed by proper masking of read() result value (`return b[0] & 0xff`).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kapyar Victor Antonovich
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: