fix: Fixes #102 (inexact port range validation).

This commit is contained in:
Boris Grozev 2017-03-29 14:08:03 -05:00
parent 77fe6973c4
commit 9348af1624

View File

@ -692,11 +692,11 @@ public class NetworkUtils
* @param port the port number that we'd like verified. * @param port the port number that we'd like verified.
* *
* @return <tt>true</tt> if port is a valid and bindable port number and * @return <tt>true</tt> if port is a valid and bindable port number and
* <tt>alse</tt> otherwise. * <tt>false</tt> otherwise.
*/ */
public static boolean isValidPortNumber(int port) public static boolean isValidPortNumber(int port)
{ {
return MIN_PORT_NUMBER < port && port < MAX_PORT_NUMBER; return MIN_PORT_NUMBER <= port && port <= MAX_PORT_NUMBER;
} }
/** /**