mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-13 11:59:35 +03:00
Fix DoS attack vulnerability in CommandSwitchAccountFactory
This commit is contained in:
@ -139,7 +139,7 @@ func (f *CommandSwitchAccountFactory) Unmarshal(data []byte) (interface{}, error
|
||||
}
|
||||
cmd.Level = uint32(data[levelStart])
|
||||
timeStart := levelStart + 1
|
||||
if len(data) < timeStart {
|
||||
if len(data) < timeStart+1 {
|
||||
return nil, newError("insufficient length.")
|
||||
}
|
||||
cmd.ValidMin = data[timeStart]
|
||||
|
Reference in New Issue
Block a user