rdp: address comments in pull request

Pull request:
https://github.com/OISF/suricata/pull/4174

- fix commit: range -> set
- OUTPUT_BUFFER_SIZE -> JSON_OUTPUT_BUFFER_SIZE
- output: check for initdata first
pull/4188/head
Jason Ish 6 years ago committed by Victor Julien
parent caef8b5b38
commit 0f10298990

@ -53,7 +53,7 @@ fn desktop_scale_to_opt(x: u32) -> Option<u32> {
}
}
/// constrains device scale to a range, per spec
/// constrains device scale to a set of valid values, per spec
/// rdp-spec, section 2.2.1.3.2 Client Core Data
fn device_scale_to_opt(x: u32) -> Option<u32> {
if x == 100 || x == 140 || x == 180 {

@ -117,22 +117,19 @@ static OutputInitResult OutputRdpLogInitSub(ConfNode *conf,
return result;
}
#define OUTPUT_BUFFER_SIZE 65535
static TmEcode JsonRdpLogThreadInit(ThreadVars *t, const void *initdata, void **data)
{
LogRdpLogThread *thread = SCCalloc(1, sizeof(*thread));
if (unlikely(thread == NULL)) {
if (initdata == NULL) {
SCLogDebug("Error getting context for EveLogRdp. \"initdata\" is NULL.");
return TM_ECODE_FAILED;
}
if (initdata == NULL) {
SCLogDebug("Error getting context for EveLogRdp. \"initdata\" is NULL.");
SCFree(thread);
LogRdpLogThread *thread = SCCalloc(1, sizeof(*thread));
if (unlikely(thread == NULL)) {
return TM_ECODE_FAILED;
}
thread->buffer = MemBufferCreateNew(OUTPUT_BUFFER_SIZE);
thread->buffer = MemBufferCreateNew(JSON_OUTPUT_BUFFER_SIZE);
if (unlikely(thread->buffer == NULL)) {
SCFree(thread);
return TM_ECODE_FAILED;

Loading…
Cancel
Save