]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
afl - SCHINfoLoadFromConfig - check for NULL before parsing.
authorJason Ish <ish@unx.ca>
Mon, 20 Apr 2015 18:12:55 +0000 (12:12 -0600)
committerVictor Julien <victor@inliniac.net>
Thu, 30 Apr 2015 12:50:42 +0000 (14:50 +0200)
Found by AFL on suricata.yaml.

src/util-host-os-info.c

index 8438d198971b60e2e02be173e8a004243962a4e6..ad0de7e25ad307944be3da23ba4d58ffab048f85 100644 (file)
@@ -342,7 +342,7 @@ void SCHInfoLoadFromConfig(void)
         ConfNode *host;
         TAILQ_FOREACH(host, &policy->head, next) {
             int is_ipv4 = 1;
-            if (index(host->val, ':') != NULL)
+            if (host->val != NULL && index(host->val, ':') != NULL)
                 is_ipv4 = 0;
             if (SCHInfoAddHostOSInfo(policy->name, host->val, is_ipv4) == -1) {
                 SCLogError(SC_ERR_INVALID_ARGUMENT,