We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b8bc87 commit 7a14903Copy full SHA for 7a14903
1 file changed
pkg/protocol/handshake/message_server_hello.go
@@ -88,11 +88,14 @@ func (m *MessageServerHello) Unmarshal(data []byte) error {
88
m.SessionID = append([]byte{}, data[currOffset:currOffset+n]...)
89
currOffset += len(m.SessionID)
90
91
+ if len(data) < currOffset+2 {
92
+ return errBufferTooSmall
93
+ }
94
m.CipherSuiteID = new(uint16)
95
*m.CipherSuiteID = binary.BigEndian.Uint16(data[currOffset:])
96
currOffset += 2
97
- if len(data) < currOffset {
98
+ if len(data) <= currOffset {
99
return errBufferTooSmall
100
}
101
if compressionMethod, ok := protocol.CompressionMethods()[protocol.CompressionMethodID(data[currOffset])]; ok {
0 commit comments