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
path: root/xray
diff options
context:
space:
mode:
Diffstat (limited to 'xray')
-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)
}