]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
config: fix null dereference in MacSetRegisterFlowStorage
authorPhilippe Antoine <contact@catenacyber.fr>
Fri, 11 Jun 2021 12:13:44 +0000 (14:13 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 15 Jun 2021 07:57:05 +0000 (09:57 +0200)
Crash happens with
--set outputs.eve-json.types.files.force-magic=yes

src/util-macset.c

index 81a40a8c42e1c0a00fd05a5d29fa142869f4cc5c..56d7539af698079316d7ad80404cea66555813e6 100644 (file)
@@ -66,7 +66,7 @@ void MacSetRegisterFlowStorage(void)
        has the ethernet setting enabled */
     if (root != NULL) {
         TAILQ_FOREACH(node, &root->head, next) {
-            if (strcmp(node->val, "eve-log") == 0) {
+            if (node->val && strcmp(node->val, "eve-log") == 0) {
                 const char *enabled = ConfNodeLookupChildValue(node->head.tqh_first, "enabled");
                 if (enabled != NULL && ConfValIsTrue(enabled)) {
                     const char *ethernet = ConfNodeLookupChildValue(node->head.tqh_first, "ethernet");