proxy progress

This commit is contained in:
rusefi 2020-07-08 13:53:51 -04:00
parent 12a9d64e31
commit 30b5b7ba05
1 changed files with 2 additions and 0 deletions

View File

@ -156,6 +156,8 @@ public class BinaryProtocolServer implements BinaryProtocolCommands {
}
public static Packet readPromisedBytes(DataInputStream in, int length) throws IOException {
if (length < 0)
throw new IllegalArgumentException(String.format("Negative %d %x", length, length));
byte[] packet = new byte[length];
int size = in.read(packet);
if (size != packet.length)