diff --git a/quic_frame.go b/quic_frame.go index 103e958..db5f964 100644 --- a/quic_frame.go +++ b/quic_frame.go @@ -90,7 +90,7 @@ func ReassembleCRYPTOFrames(frames []QUICFrame) ([]byte, error) { // Reassemble CRYPTO frames var reassembled []byte = make([]byte, 0) for _, frame := range cryptoFrames { - if uint64(len(reassembled)) == frame.(*CRYPTO).Offset { + if cryptoFrames[0].(*CRYPTO).Offset+uint64(len(reassembled)) == frame.(*CRYPTO).Offset { reassembled = append(reassembled, frame.(*CRYPTO).data...) } else { return nil, fmt.Errorf("failed to reassemble CRYPTO frames")