]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2918 in SNORT/snort3 from ~NIHDESAI/snort3:nhi_section_size to...
authorTom Peters (thopeter) <thopeter@cisco.com>
Mon, 7 Jun 2021 05:26:01 +0000 (05:26 +0000)
committerTom Peters (thopeter) <thopeter@cisco.com>
Mon, 7 Jun 2021 05:26:01 +0000 (05:26 +0000)
Squashed commit of the following:

commit ac6c621966284a445cc295569842129e24517951
Author: Nihal Desai <nihdesai@cisco.com>
Date:   Wed Jun 2 15:02:09 2021 -0400

    http_inspect: limit section size target for file processing

src/service_inspectors/http_inspect/http_msg_section.cc

index e6277c6f5b32f29279c673f58b69832b3e362c62..110fb6d941d9fd1676321ae695f16fb267b067fb 100644 (file)
@@ -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;
     }