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
This commit is contained in:
parent
bf5c928796
commit
4d271ddefe
@ -63,7 +63,7 @@ public final class SocksCmdRequest extends SocksRequest {
|
|||||||
case UNKNOWN:
|
case UNKNOWN:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (port < 0 && port >= 65535) {
|
if (port < 0 && port >= 65536) {
|
||||||
throw new IllegalArgumentException(port + " is not in bounds 0 < x < 65536");
|
throw new IllegalArgumentException(port + " is not in bounds 0 < x < 65536");
|
||||||
}
|
}
|
||||||
this.cmdType = cmdType;
|
this.cmdType = cmdType;
|
||||||
|
Loading…
Reference in New Issue
Block a user