Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShishkevich D. <135337715+shishkevichd@users.noreply.github.com>2025-06-17 18:45:03 +0300
committerGitHub <noreply@github.com>2025-06-17 18:45:03 +0300
commitf86219f4de750c2ee2654c7e09435a608c894443 (patch)
treec8c0cbb64c732ad7ec6286aa89819f0eed401084 /xray/api.go
parente272c160b12ff8ae8d0d3812756e986ace72a924 (diff)
refactor: use `math.MaxUint16` when checking port
Diffstat (limited to 'xray/api.go')
-rw-r--r--xray/api.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/xray/api.go b/xray/api.go
index 3a2dddd6..d68b1f96 100644
--- a/xray/api.go
+++ b/xray/api.go
@@ -6,6 +6,7 @@ import (
"fmt"
"regexp"
"time"
+ "math"
"x-ui/logger"
"x-ui/util/common"
@@ -32,7 +33,7 @@ type XrayAPI struct {
}
func (x *XrayAPI) Init(apiPort int) error {
- if apiPort <= 0 {
+ if apiPort <= 0 || apiPort > math.MaxUint16 {
return fmt.Errorf("invalid Xray API port: %d", apiPort)
}