Skip to content

Commit

Permalink
fix: use constant MAX_PACKET_SIZE (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuisathaverat authored Jul 15, 2022
1 parent 97e7f91 commit bd92894
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/com/trilead/ssh2/transport/TransportConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ private static int getPacketLength(byte[] packetHeader, boolean isEtm) throws IO
| ((packetHeader[1] & 0xff) << 16) | ((packetHeader[2] & 0xff) << 8)
| ((packetHeader[3] & 0xff));

if (packetLength > 35000 || packetLength < (isEtm ? 8 : 12))
if (packetLength > TransportManager.MAX_PACKET_SIZE || packetLength < (isEtm ? 8 : 12))
throw new IOException("Illegal packet size! (" + packetLength + ")");

return packetLength;
Expand Down

0 comments on commit bd92894

Please sign in to comment.