prevent reading 0 bytes

pull/1162/head
Darien Raymond 2018-02-26 17:50:14 +01:00
parent 6a3abf3147
commit b7d48fe7c5
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 1 additions and 1 deletions

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)