From f59ce70c176fcdc0a6d61dde7d711dd5dc810499 Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Fri, 18 Jan 2013 00:23:49 +0530 Subject: [PATCH] fix for #694. Invalidate any address/port vars in the conf that uses a sequence without quotes. --- src/detect-engine-address.c | 8 ++++++++ src/detect-engine-port.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/detect-engine-address.c b/src/detect-engine-address.c index d59599aed1..aa3c2d77d0 100644 --- a/src/detect-engine-address.c +++ b/src/detect-engine-address.c @@ -1250,6 +1250,14 @@ int DetectAddressTestConfVars(void) goto error; } + if (seq_node->val == NULL) { + SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY, + "Address var \"%s\" probably has a sequence(something " + "in brackets) value set without any quotes. Please " + "quote it using \"..\".", seq_node->name); + goto error; + } + int r = DetectAddressParse2(gh, ghn, seq_node->val, /* start with negate no */0); if (r < 0) { SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY, diff --git a/src/detect-engine-port.c b/src/detect-engine-port.c index 1ccb29dd7e..45e7e7b12f 100644 --- a/src/detect-engine-port.c +++ b/src/detect-engine-port.c @@ -1308,6 +1308,14 @@ int DetectPortTestConfVars(void) } DetectPort *ghn = NULL; + if (seq_node->val == NULL) { + SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY, + "Port var \"%s\" probably has a sequence(something " + "in brackets) value set without any quotes. Please " + "quote it using \"..\".", seq_node->name); + goto error; + } + int r = DetectPortParseDo(&gh, &ghn, seq_node->val, /* start with negate no */0); if (r < 0) { goto error;