From: Philippe Antoine Date: Mon, 17 Jun 2024 13:38:11 +0000 (+0200) Subject: sip: use right slice to take line from X-Git-Tag: suricata-8.0.0-beta1~1152 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11312%2Fhead;p=thirdparty%2Fsuricata.git 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 --- 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);