]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
fix for #694.
authorAnoop Saldanha <anoopsaldanha@gmail.com>
Thu, 17 Jan 2013 18:53:49 +0000 (00:23 +0530)
committerVictor Julien <victor@inliniac.net>
Fri, 25 Jan 2013 13:31:03 +0000 (14:31 +0100)
Invalidate any address/port vars in the conf that uses a sequence
without quotes.

src/detect-engine-address.c
src/detect-engine-port.c

index d59599aed19a4a891c45e6c39fd2086beca4e877..aa3c2d77d0ee360633619d3776062eb06ba36a14 100644 (file)
@@ -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,
index 1ccb29dd7e644b5f486278aa588100c07d027468..45e7e7b12fb6c7753a38de394d6a2c9a42a1e930 100644 (file)
@@ -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;