瀏覽代碼

check input value nil

v2ray 9 年之前
父節點
當前提交
f735663364
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      proxy/vmess/command/accounts.go

+ 3 - 0
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