From: Jason Ish Date: Mon, 20 Apr 2015 18:12:55 +0000 (-0600) Subject: afl - SCHINfoLoadFromConfig - check for NULL before parsing. X-Git-Tag: suricata-2.1beta4~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=11d6770ae4814a7b61fd53bdf9ec02a20c1b482d;p=thirdparty%2Fsuricata.git afl - SCHINfoLoadFromConfig - check for NULL before parsing. Found by AFL on suricata.yaml. --- diff --git a/src/util-host-os-info.c b/src/util-host-os-info.c index 8438d19897..ad0de7e25a 100644 --- a/src/util-host-os-info.c +++ b/src/util-host-os-info.c @@ -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,