Fix an edge case with tls hello fragment

pull/3245/head
yuhan6665 8 months ago
parent e64fb3ca9b
commit 548646fb06

@ -373,6 +373,9 @@ func (f *FragmentWriter) Write(b []byte) (int, error) {
return f.writer.Write(b) return f.writer.Write(b)
} }
recordLen := 5 + ((int(b[3]) << 8) | int(b[4])) recordLen := 5 + ((int(b[3]) << 8) | int(b[4]))
if len(b) < recordLen { // maybe already fragmented somehow
return f.writer.Write(b)
}
data := b[5:recordLen] data := b[5:recordLen]
buf := make([]byte, 1024) buf := make([]byte, 1024)
for from := 0; ; { for from := 0; ; {

Loading…
Cancel
Save