File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -399,9 +399,7 @@ func (q *quicPacketSender) readQuicData(b []byte) error {
399
399
}
400
400
}
401
401
402
- _ = q .tryAssemble ()
403
-
404
- return nil
402
+ return q .tryAssemble ()
405
403
}
406
404
407
405
func (q * quicPacketSender ) tryAssemble () error {
@@ -415,7 +413,17 @@ func (q *quicPacketSender) tryAssemble() error {
415
413
416
414
if len (q .ranges ) != 1 || q .ranges [0 ].Start () != 0 || q .ranges [0 ].End () != uint64 (len (q .buffer )) {
417
415
q .lock .RUnlock ()
418
- return ErrNoClue
416
+ // incomplete fragment, just return
417
+ return nil
418
+ }
419
+
420
+ if len (q .buffer ) <= 4 ||
421
+ // Handshake Type (1) + uint24 Length (3) + ClientHello body
422
+ // maxCryptoStreamOffset is in the valid range of uint16 so just ignore the q.buffer[1]
423
+ int (binary .BigEndian .Uint16 ([]byte {q .buffer [2 ], q .buffer [3 ]})+ 4 ) != len (q .buffer ) {
424
+ q .lock .RUnlock ()
425
+ // end of segment not reached, just return
426
+ return nil
419
427
}
420
428
421
429
domain , err := ReadClientHello (q .buffer )
You can’t perform that action at this time.
0 commit comments