mirror of https://github.com/v2ray/v2ray-core
check input value nil
parent
790d37bf90
commit
f735663364
|
@ -54,6 +54,9 @@ func (this *SwitchAccount) Marshal(writer io.Writer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *SwitchAccount) Unmarshal(data []byte) error {
|
func (this *SwitchAccount) Unmarshal(data []byte) error {
|
||||||
|
if len(data) == 0 {
|
||||||
|
return transport.CorruptedPacket
|
||||||
|
}
|
||||||
lenHost := int(data[0])
|
lenHost := int(data[0])
|
||||||
if len(data) < lenHost+1 {
|
if len(data) < lenHost+1 {
|
||||||
return transport.CorruptedPacket
|
return transport.CorruptedPacket
|
||||||
|
|
Loading…
Reference in New Issue