TCP: don't read past the prefixed size

Maybe
fixes #219
This commit is contained in:
Frank Denis 2018-03-10 18:50:31 -08:00
parent 3d50549cae
commit ba2f43e6db
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ func ReadPrefixed(conn *net.TCPConn) ([]byte, error) {
}
}
if pos >= 2+packetLength {
return buf[2:pos], nil
return buf[2:2+packetLength], nil
}
}
}