From b2c4dacd25e1f8ecc4ea2a8209f7d90ec6866f16 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sun, 24 May 2020 12:59:47 +0700 Subject: [PATCH] fix int overflow when parsing the transport parameters --- internal/wire/transport_parameters.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/wire/transport_parameters.go b/internal/wire/transport_parameters.go index 2d02f399..da6ff50a 100644 --- a/internal/wire/transport_parameters.go +++ b/internal/wire/transport_parameters.go @@ -129,7 +129,7 @@ func (p *TransportParameters) unmarshal(data []byte, sentBy protocol.Perspective return err } default: - if r.Len() < int(paramLen) { + if uint64(r.Len()) < paramLen { return fmt.Errorf("remaining length (%d) smaller than parameter length (%d)", r.Len(), paramLen) } switch paramID {