]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
minor update
authorhuica <huica@cisco.com>
Mon, 3 Aug 2015 16:05:15 +0000 (12:05 -0400)
committerhuica <huica@cisco.com>
Mon, 3 Aug 2015 16:05:15 +0000 (12:05 -0400)
src/utils/sf_email_attach_decode.cc
src/utils/sf_email_attach_decode.h

index b8aa8e77ba03b6624d882c2dd9fb6e704bbd2ab5..8fba8222e2766b2c832a28e34040df46981bd4fa 100644 (file)
@@ -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()
index 78130fc5bc74c12790dcb61d10c3e55d16afcded..a7974409174f492643997e812e2b6558558a2e84 100644 (file)
@@ -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;