mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-06 15:20:54 +03:00
fix potential bug / negative bytes
This commit is contained in:
@@ -109,7 +109,7 @@ public final class ChannelInputStream
|
|||||||
public int read()
|
public int read()
|
||||||
throws IOException {
|
throws IOException {
|
||||||
synchronized (b) {
|
synchronized (b) {
|
||||||
return read(b, 0, 1) == -1 ? -1 : b[0];
|
return read(b, 0, 1) == -1 ? -1 : b[0] & 0xff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ public class RemoteFile
|
|||||||
@Override
|
@Override
|
||||||
public int read()
|
public int read()
|
||||||
throws IOException {
|
throws IOException {
|
||||||
return read(b, 0, 1) == -1 ? -1 : b[0];
|
return read(b, 0, 1) == -1 ? -1 : b[0] & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user