MINA SSHD
  1. MINA SSHD
  2. SSHD-79

ChannelPipedInputStream returns improper negative values for some bytes.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major 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()

        Issue Links

          Activity

          Bill Kuker created issue -
          Guillaume Nodet made changes -
          Field Original Value New Value
          Link This issue is duplicated by SSHD-84 [ SSHD-84 ]
          Guillaume Nodet made changes -
          Fix Version/s 0.4.0 [ 12314444 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Guillaume Nodet [ gnt ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development