Limit PortFinder to 0xFFFF

This commit is contained in:
Charles Allen 2016-02-25 08:09:08 -08:00
parent 917e7e58f5
commit 3fa7a7ebfe
1 changed files with 2 additions and 1 deletions

View File

@ -95,7 +95,8 @@ public class PortFinder
private int chooseNext(int start)
{
for (int i = start; i < Integer.MAX_VALUE; i++) {
// up to unsigned short max (65535)
for (int i = start; i <= 0xFFFF; i++) {
if (!usedPorts.contains(i)) {
return i;
}