From 4d271ddefec92560a38ba5e381800a95cfd50821 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Tue, 29 Apr 2014 17:55:13 +0900 Subject: [PATCH] Fix incorrect port range check Motivation: In the Internet Protocol, the valid port number range is from 1 to 65535 (inclusive on the both side.) However, SocksCmdRequest refuses to construct itself when the port number 65535 is specified. Modification: Do not raise an exception when the specified port number is 65535. Result: Fixes #2428 --- .../main/java/io/netty/handler/codec/socks/SocksCmdRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksCmdRequest.java b/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksCmdRequest.java index c73a5ca5ac..6411cb75a9 100644 --- a/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksCmdRequest.java +++ b/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksCmdRequest.java @@ -63,7 +63,7 @@ public final class SocksCmdRequest extends SocksRequest { case UNKNOWN: break; } - if (port < 0 && port >= 65535) { + if (port < 0 && port >= 65536) { throw new IllegalArgumentException(port + " is not in bounds 0 < x < 65536"); } this.cmdType = cmdType;