1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-30 07:46:41 -04:00

check input value nil

This commit is contained in:
v2ray 2016-01-22 17:56:12 +01:00
parent 790d37bf90
commit f735663364

View File

@ -54,6 +54,9 @@ func (this *SwitchAccount) Marshal(writer io.Writer) {
}
func (this *SwitchAccount) Unmarshal(data []byte) error {
if len(data) == 0 {
return transport.CorruptedPacket
}
lenHost := int(data[0])
if len(data) < lenHost+1 {
return transport.CorruptedPacket