diff --git a/proxy/vmess/io/reader.go b/proxy/vmess/io/reader.go index 0c42031e1..5dab18ff1 100644 --- a/proxy/vmess/io/reader.go +++ b/proxy/vmess/io/reader.go @@ -30,11 +30,10 @@ func (this *AuthChunkReader) Read() (*alloc.Buffer, error) { if length <= 4 { // Length of authentication bytes. return nil, io.EOF } - if length > 8*1024 { + if length > 8*1024-16 { buffer.Release() buffer = alloc.NewLargeBuffer() } - buffer.SliceBack(16) if _, err := io.ReadFull(this.reader, buffer.Value[:length]); err != nil { buffer.Release() return nil, err