From b236d085681ea019bf96c71927049b2e72c4f9d4 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Tue, 15 Oct 2024 14:08:05 +0200 Subject: [PATCH] fix: Don't retire zero-length connection IDs --- neqo-transport/src/path.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/neqo-transport/src/path.rs b/neqo-transport/src/path.rs index 71b9fa96d8..28cb46ef20 100644 --- a/neqo-transport/src/path.rs +++ b/neqo-transport/src/path.rs @@ -152,13 +152,13 @@ impl Paths { } fn retire(to_retire: &mut Vec, retired: &PathRef) { - let seqno = retired - .borrow() - .remote_cid - .as_ref() - .unwrap() - .sequence_number(); - to_retire.push(seqno); + if let Some(cid) = &retired.borrow().remote_cid { + if cid.connection_id().len() == 0 { + qinfo!("Not retiring zero-len connection ID"); + } else { + to_retire.push(cid.sequence_number()); + } + } } /// Adopt a temporary path as permanent.