From: huica Date: Mon, 3 Aug 2015 16:05:15 +0000 (-0400) Subject: minor update X-Git-Tag: 3.0.0-233~828^2~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5cd8a5900abcea78cc6eba574e082f24627bb56;p=thirdparty%2Fsnort3.git minor update --- diff --git a/src/utils/sf_email_attach_decode.cc b/src/utils/sf_email_attach_decode.cc index b8aa8e77b..8fba8222e 100644 --- a/src/utils/sf_email_attach_decode.cc +++ b/src/utils/sf_email_attach_decode.cc @@ -423,16 +423,20 @@ DataDecode::DataDecode(int max_depth) else buf_size = max_depth; - work_buffer = (uint8_t*)SnortAlloc(2*buf_size); + encode_depth = decode_depth = max_depth; + encode_bytes_read = decode_bytes_read = 0; prev_encoded_bytes = 0; prev_encoded_buf = nullptr; decoded_bytes = 0; + if (max_depth < 0) + return; + + work_buffer = (uint8_t*)SnortAlloc(2*buf_size); encodeBuf = (uint8_t*)work_buffer; decodeBuf = (uint8_t*)work_buffer + buf_size; - encode_depth = decode_depth = max_depth; - encode_bytes_read = decode_bytes_read = 0; + } DataDecode::~DataDecode() diff --git a/src/utils/sf_email_attach_decode.h b/src/utils/sf_email_attach_decode.h index 78130fc5b..a79744091 100644 --- a/src/utils/sf_email_attach_decode.h +++ b/src/utils/sf_email_attach_decode.h @@ -38,7 +38,7 @@ class DataDecode { public: DataDecode(int max_depth); - ~DataDecode(); + virtual ~DataDecode(); // Main function to decode file data virtual DecodeResult decode_data(const uint8_t* start, const uint8_t* end) = 0;