From f735663364e3568ba38375999711069dcffefe18 Mon Sep 17 00:00:00 2001 From: v2ray Date: Fri, 22 Jan 2016 17:56:12 +0100 Subject: [PATCH] check input value nil --- proxy/vmess/command/accounts.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxy/vmess/command/accounts.go b/proxy/vmess/command/accounts.go index 60e06f27..5ba3996f 100644 --- a/proxy/vmess/command/accounts.go +++ b/proxy/vmess/command/accounts.go @@ -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