diff --git a/src/crypto/tls/handshake_messages.go b/src/crypto/tls/handshake_messages.go index 799a776799..111ce53487 100644 --- a/src/crypto/tls/handshake_messages.go +++ b/src/crypto/tls/handshake_messages.go @@ -763,6 +763,10 @@ func (m *serverHelloMsg) unmarshal(data []byte) bool { return false } d = d[1:] + if len(d) == 0 { + // ALPN protocols must not be empty. + return false + } m.alpnProtocol = string(d) case extensionSCT: d := data[:length]