From fdf3420c59494b65e181e04bb5f00592096e78e8 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Tue, 23 Apr 2024 12:06:38 +0200 Subject: [PATCH] Do not panic on too mange DTLS fragments --- src/dtls_combine.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dtls_combine.rs b/src/dtls_combine.rs index e668f2b..c203acb 100644 --- a/src/dtls_combine.rs +++ b/src/dtls_combine.rs @@ -33,7 +33,7 @@ pub fn combine_dtls_fragments<'a>( } if fragments.len() > MAX_FRAGMENTS { - panic!("More than max fragments"); + return Err(Err::Error(make_error(&*out, ErrorKind::TooLarge))); } const MESSAGE_HEADER_OFFSET: usize = 12;