mirror of
https://github.com/MetaCubeX/Clash.Meta.git
synced 2025-04-04 05:33:35 +03:00
fix: integer overflow in ports iteration
This commit is contained in:
parent
136d114196
commit
05e8f13a8d
1 changed files with 4 additions and 1 deletions
|
@ -139,10 +139,13 @@ func (ranges IntRanges[T]) Range(f func(t T) bool) {
|
|||
}
|
||||
|
||||
for _, r := range ranges {
|
||||
for i := r.Start(); i <= r.End(); i++ {
|
||||
for i := r.Start(); i <= r.End() && i >= r.Start(); i++ {
|
||||
if !f(i) {
|
||||
return
|
||||
}
|
||||
if i+1 < i { // integer overflow
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue