mirror of
https://github.com/apernet/hysteria.git
synced 2025-04-02 03:57:38 +03:00
fix: inf loop in PortUnion.Ports() when end=65535
fix: #1240 Any uint16 value is less than or equal to 65535.
This commit is contained in:
parent
78598bfd1b
commit
d65997c02b
1 changed files with 4 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
"math"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -91,6 +92,9 @@ func (u PortUnion) Ports() []uint16 {
|
|||
for _, r := range u {
|
||||
for i := r.Start; i <= r.End; i++ {
|
||||
ports = append(ports, i)
|
||||
if i == math.MaxUint16 {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return ports
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue