Skip to content

Commit

Permalink
sip: use right slice to take line from
Browse files Browse the repository at this point in the history
We iterate over input, but we are now at start.
Avois quadratic complexity turning to OOM.

Ticket: 7093
  • Loading branch information
catenacyber committed Jun 17, 2024
1 parent 49ecf37 commit 4ccbcc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rust/src/sip/sip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4ccbcc4

Please sign in to comment.