]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
sip: use right slice to take line from 11312/head
authorPhilippe Antoine <pantoine@oisf.net>
Mon, 17 Jun 2024 13:38:11 +0000 (15:38 +0200)
committerPhilippe Antoine <pantoine@oisf.net>
Mon, 17 Jun 2024 13:38:11 +0000 (15:38 +0200)
We iterate over input, but we are now at start.
Avois quadratic complexity turning to OOM.

Ticket: 7093

rust/src/sip/sip.rs

index a7613bb671d2de8c74337fe8b2531a4596b9ab54..6d38c8fd7e4f8c67e658acf908c864e518fdc7a9 100755 (executable)
@@ -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);