From: Bhargava Jandhyala (bjandhya) Date: Fri, 11 Dec 2020 13:02:48 +0000 (+0000) Subject: Merge pull request #2663 in SNORT/snort3 from ~DIPANDIT/snort3:file_stat to master X-Git-Tag: 3.0.3-6~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17ac2bf130b38ad8efabbea745df53093a45835a;p=thirdparty%2Fsnort3.git Merge pull request #2663 in SNORT/snort3 from ~DIPANDIT/snort3:file_stat to master Squashed commit of the following: commit 55bed1f3cba5e8cdedc29e044bb1d802618aaa62 Author: Dipto Pandit Date: Thu Dec 10 05:31:04 2020 -0500 file_api: fixed stats which weren't cleared when there were no stats for signature processing --- diff --git a/src/file_api/file_stats.cc b/src/file_api/file_stats.cc index a6daf4737..237f93d7e 100644 --- a/src/file_api/file_stats.cc +++ b/src/file_api/file_stats.cc @@ -81,7 +81,10 @@ void file_stats_print() } if ( !check_total ) + { + memset(&file_totals,0,sizeof(file_totals)); return; + } LogLabel("File Statistics"); LogLabel("file type stats (files)"); @@ -143,7 +146,10 @@ void file_stats_print() } if ( !check_total ) + { + memset(&file_totals,0,sizeof(file_totals)); return; + } LogLabel("file signature stats"); @@ -167,8 +173,6 @@ void file_stats_print() LogMessage(" Total " FMTu64("-10") " " FMTu64("-10") " \n", processed_total[0], processed_total[1]); - memset(&file_totals,0,sizeof(file_totals)); - #if 0 LogLabel("file type verdicts"); // FIXIT-RC should be fixed @@ -279,5 +283,6 @@ void file_stats_print() #endif // these are global / shared by all threads FileCapture::print_mem_usage(); + memset(&file_totals,0,sizeof(file_totals)); }