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

ChannelPipedInputStream returns improper negative values for some bytes.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.1.0, 0.2.0, 0.3.0, 0.4.0
    • Fix Version/s: 0.4.0
    • Labels:
      None

      Description

      The function:

      public int read() throws IOException {
      synchronized (b) {
      int l = read(b, 0, 1);
      if (l == -1)

      { return -1; }
      return b[0];
      }
      }

      Will return negative values for negative bytes. It must read:

      public int read() throws IOException {
      synchronized (b) {
      int l = read(b, 0, 1);
      if (l == -1) { return -1; }

      return ((int)b[0] & 0xff);
      }
      }

      instead to return values in the range of 0-255 per java.io.InputStream read()

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gnt Guillaume Nodet
                Reporter:
                bkuker1 Bill Kuker
              • Votes:
                1 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: