From 0473d71bea4c7896e50a8e48bf679ff7d5d9b04e Mon Sep 17 00:00:00 2001 From: Andy Wang Date: Sat, 19 Dec 2020 20:49:21 +0000 Subject: [PATCH] Fix overflow in padding length calculation --- internal/multiplex/session.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/multiplex/session.go b/internal/multiplex/session.go index e1ab275..c808e2b 100644 --- a/internal/multiplex/session.go +++ b/internal/multiplex/session.go @@ -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 }