From: Mike Stepanek (mstepane) Date: Wed, 10 Nov 2021 15:03:43 +0000 (+0000) Subject: Pull request #3152: Dynamic buffer for trace internal data. X-Git-Tag: 3.1.17.0~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6cfa0664388eb06f5aed582c80308c470989348;p=thirdparty%2Fsnort3.git Pull request #3152: Dynamic buffer for trace internal data. Merge in SNORT/snort3 from ~OSHUMEIK/snort3:trace_buffer to master Squashed commit of the following: commit 4d5bebcb0fa5835d931bca3ec994f2c71029b20b Author: Oleksii Shumeiko Date: Fri Nov 5 22:20:04 2021 +0200 main: use dynamic buffer on demand in trace print functions --- diff --git a/src/main/snort_debug.cc b/src/main/snort_debug.cc index 0132380a5..9d13bc8eb 100644 --- a/src/main/snort_debug.cc +++ b/src/main/snort_debug.cc @@ -29,7 +29,8 @@ #include "trace/trace_api.h" #include "utils/safec.h" -#define STD_BUF_SIZE 1024 +#define BUF_SIZE_MIN (1 << 10) // guaranteed size, this one will be allocated on stack +#define BUF_SIZE_MAX (1 << 20) // this prevents unlimited memory allocation namespace snort { @@ -37,10 +38,60 @@ template