From: huica Date: Thu, 17 Sep 2015 19:34:06 +0000 (-0400) Subject: Check file processing for response X-Git-Tag: 3.0.0-233~828^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30fea040cd4f0308a1d65eed84d70a2887511c2b;p=thirdparty%2Fsnort3.git Check file processing for response --- diff --git a/src/service_inspectors/nhttp_inspect/nhttp_msg_body.cc b/src/service_inspectors/nhttp_inspect/nhttp_msg_body.cc index 0b3e712f3..96f9f35fd 100644 --- a/src/service_inspectors/nhttp_inspect/nhttp_msg_body.cc +++ b/src/service_inspectors/nhttp_inspect/nhttp_msg_body.cc @@ -93,7 +93,7 @@ void NHttpMsgBody::do_file_processing() { FileFlows* file_flows = FileFlows::get_file_flows(flow); - if (file_flows && file_flows->file_process(file_data.start, fp_length, + if (file_flows->file_process(file_data.start, fp_length, file_position, false, false)) { session_data->file_depth_remaining[source_id] -= fp_length; diff --git a/src/service_inspectors/nhttp_inspect/nhttp_msg_header.cc b/src/service_inspectors/nhttp_inspect/nhttp_msg_header.cc index 6bf44c042..3441949dd 100644 --- a/src/service_inspectors/nhttp_inspect/nhttp_msg_header.cc +++ b/src/service_inspectors/nhttp_inspect/nhttp_msg_header.cc @@ -126,18 +126,22 @@ void NHttpMsgHeader::setup_file_processing() // fully supports it remove the outer if statement that prevents it from being done. if (session_data->file_depth_remaining[1-source_id] == 0) { - FileFlows* file_flows = FileFlows::get_file_flows(flow); - if (!file_flows) - return; - if ((session_data->file_depth_remaining[source_id] = FileService::get_max_file_depth()) < 0) { session_data->file_depth_remaining[source_id] = 0; + return; } + if (source_id == SRC_CLIENT) { session_data->mime_state = new MimeSession(&decode_conf, &mime_conf); } + else + { + FileFlows* file_flows = FileFlows::get_file_flows(flow); + if (!file_flows) + session_data->file_depth_remaining[source_id] = 0; + } } } diff --git a/src/service_inspectors/nhttp_inspect/nhttp_stream_splitter.cc b/src/service_inspectors/nhttp_inspect/nhttp_stream_splitter.cc index 57606d779..39c01db8e 100644 --- a/src/service_inspectors/nhttp_inspect/nhttp_stream_splitter.cc +++ b/src/service_inspectors/nhttp_inspect/nhttp_stream_splitter.cc @@ -493,8 +493,7 @@ bool NHttpStreamSplitter::finish(Flow* flow) if (source_id == SRC_SERVER) { FileFlows* file_flows = FileFlows::get_file_flows(flow); - if (file_flows) - file_flows->file_process(nullptr, 0, SNORT_FILE_END, false, false); + file_flows->file_process(nullptr, 0, SNORT_FILE_END, false, false); } else {