Fix overflow in padding length calculation

This commit is contained in:
Andy Wang 2020-12-19 20:49:21 +00:00
parent 1e41aabe7d
commit 0473d71bea
No known key found for this signature in database
GPG Key ID: 181B49F9F38F3374
1 changed files with 1 additions and 1 deletions

View File

@ -291,7 +291,7 @@ func (sesh *Session) passiveClose() error {
func genRandomPadding() []byte {
lenB := make([]byte, 1)
common.CryptoRandRead(lenB)
pad := make([]byte, lenB[0]+1)
pad := make([]byte, int(lenB[0])+1)
common.CryptoRandRead(pad)
return pad
}