crypto/tls: fix panic in PSK binders parsing

BoGo: Resume-Server-ExtraPSKBinder
This commit is contained in:
Filippo Valsorda 2017-01-16 13:28:52 +00:00 committed by Peter Wu
parent bbb712bfd8
commit 5406418371

View File

@ -651,7 +651,7 @@ func (m *clientHelloMsg) unmarshal(data []byte) bool {
} }
i := 0 i := 0
for len(d) > 0 { for len(d) > 0 {
if len(d) < 1 { if len(d) < 1 || i >= len(m.psks) {
return false return false
} }
l := int(d[0]) l := int(d[0])