1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-05-04 11:39:08 -04:00

prevent reading 0 bytes

This commit is contained in:
Darien Raymond
2018-02-26 17:50:14 +01:00
parent 6a3abf3147
commit b7d48fe7c5

View File

@@ -68,7 +68,7 @@ func ReadTCPSession(user *protocol.User, reader io.Reader) (*protocol.RequestHea
if err != nil {
// Invalid address. Continue to read some bytes to confuse client.
nBytes := dice.Roll(32)
nBytes := dice.Roll(32) + 1
buffer.Clear()
buffer.AppendSupplier(buf.ReadFullFrom(br, nBytes))
return nil, nil, newError("failed to read address").Base(err)