From 30a0aa6fb0cf15cf5182c351d9908cbc30a377bd Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Fri, 9 Feb 2018 17:56:39 +0100 Subject: [PATCH] don't read 0 bytes --- proxy/vmess/encoding/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/vmess/encoding/server.go b/proxy/vmess/encoding/server.go index d58914c1a..ea6bffa63 100644 --- a/proxy/vmess/encoding/server.go +++ b/proxy/vmess/encoding/server.go @@ -213,7 +213,7 @@ func (s *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Request } if invalidRequest { - randomLen := dice.Roll(32) + randomLen := dice.Roll(32) + 1 // Read random number of bytes for prevent detection. buffer.AppendSupplier(buf.ReadFullFrom(decryptor, randomLen)) return nil, newError("invalid request")