From 4ccbcc46847e2a70d4d1bc251f3f1f751cfe7df4 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Mon, 17 Jun 2024 15:38:11 +0200 Subject: [PATCH] sip: use right slice to take line from We iterate over input, but we are now at start. Avois quadratic complexity turning to OOM. Ticket: 7093 --- rust/src/sip/sip.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/src/sip/sip.rs b/rust/src/sip/sip.rs index a7613bb671..6d38c8fd7e 100755 --- a/rust/src/sip/sip.rs +++ b/rust/src/sip/sip.rs @@ -175,7 +175,7 @@ impl SIPState { let tx_id = tx.id; sip_frames_ts(flow, &stream_slice, &request, tx_id); tx.request = Some(request); - if let Ok((_, req_line)) = sip_take_line(input) { + if let Ok((_, req_line)) = sip_take_line(start) { tx.request_line = req_line; } self.transactions.push_back(tx); @@ -270,7 +270,7 @@ impl SIPState { let tx_id = tx.id; sip_frames_tc(flow, &stream_slice, &response, tx_id); tx.response = Some(response); - if let Ok((_, resp_line)) = sip_take_line(input) { + if let Ok((_, resp_line)) = sip_take_line(start) { tx.response_line = resp_line; } self.transactions.push_back(tx); -- 2.47.2