if ( tmp != NULL )
{
decode_type = DECODE_B64;
- decoder = new B64Decode(config->get_max_depth());
+ decoder = new B64Decode(config->get_b64_depth());
detection_depth = config->get_b64_depth();
return;
}
if ( tmp != NULL )
{
decode_type = DECODE_QP;
- decoder = new QPDecode(config->get_max_depth());
+ decoder = new QPDecode(config->get_qp_depth());
detection_depth = config->get_qp_depth();
return;
}
if ( tmp != NULL )
{
decode_type = DECODE_UU;
- decoder = new UUDecode(config->get_max_depth());
+ decoder = new UUDecode(config->get_uu_depth());
detection_depth = config->get_uu_depth();
return;
}
if (config->get_bitenc_depth() > -1)
{
decode_type = DECODE_BITENC;
- decoder = new BitDecode(config->get_max_depth());
+ decoder = new BitDecode(config->get_bitenc_depth());
detection_depth = config->get_bitenc_depth();
return;
}
return 0;
}
+#define MAX_DEPTH 65536
+
DataDecode::DataDecode(int max_depth)
{
- work_buffer = (uint8_t*)SnortAlloc(2*max_depth);
+ if (!max_depth)
+ buf_size = MAX_DEPTH;
+ else
+ buf_size = max_depth;
+ work_buffer = (uint8_t*)SnortAlloc(2*buf_size);
prev_encoded_bytes = 0;
prev_encoded_buf = nullptr;
decoded_bytes = 0;
- buf_size = max_depth;
encodeBuf = (uint8_t*)work_buffer;
- decodeBuf = (uint8_t*)work_buffer + max_depth;
+ decodeBuf = (uint8_t*)work_buffer + buf_size;
encode_depth = decode_depth = max_depth;
encode_bytes_read = decode_bytes_read = 0;