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

ChannelPipedInputStream returns improper negative values for some bytes.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.1.0, 0.2.0, 0.3.0, 0.4.0
    • 0.4.0
    • 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

              gnodet Guillaume Nodet
              bkuker1 Bill Kuker
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: