From: Tom Peters (thopeter) Date: Mon, 7 Jun 2021 05:26:01 +0000 (+0000) Subject: Merge pull request #2918 in SNORT/snort3 from ~NIHDESAI/snort3:nhi_section_size to... X-Git-Tag: 3.1.6.0~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26af1336059ac5baf095e4fd8d9d6345846c64a4;p=thirdparty%2Fsnort3.git Merge pull request #2918 in SNORT/snort3 from ~NIHDESAI/snort3:nhi_section_size to master Squashed commit of the following: commit ac6c621966284a445cc295569842129e24517951 Author: Nihal Desai Date: Wed Jun 2 15:02:09 2021 -0400 http_inspect: limit section size target for file processing --- diff --git a/src/service_inspectors/http_inspect/http_msg_section.cc b/src/service_inspectors/http_inspect/http_msg_section.cc index e6277c6f5..110fb6d94 100644 --- a/src/service_inspectors/http_inspect/http_msg_section.cc +++ b/src/service_inspectors/http_inspect/http_msg_section.cc @@ -113,7 +113,10 @@ void HttpMsgSection::update_depth() const { // Need data for file processing or publishing session_data->stretch_section_to_packet[source_id] = true; - session_data->section_size_target[source_id] = target_size; + const int64_t max_remaining = (file_depth_remaining > publish_depth_remaining) ? + file_depth_remaining : publish_depth_remaining; + session_data->section_size_target[source_id] = (max_remaining <= target_size) ? + max_remaining : target_size; } return; }