From 282002425b07b6a8c31784bd2082af1bf2ae85ca Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Thu, 21 May 2009 17:20:54 +0000 Subject: [PATCH] Check that path is non-NULL before dereferencing it --- src/cfgfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cfgfile.c b/src/cfgfile.c index a96cb56..3c56558 100644 --- a/src/cfgfile.c +++ b/src/cfgfile.c @@ -249,7 +249,7 @@ static int match_string (const char *table[], const char *str) char *cfgfile_subst_path (const char *path, const char *subst, const char *file) { /* @@@ use strcasecmp for some targets. */ - if (strlen (path) > 0 && strncmp (file, path, strlen (path)) == 0) { + if (path && strlen (path) > 0 && strncmp (file, path, strlen (path)) == 0) { int l; char *p = xmalloc (strlen (file) + strlen (subst) + 2); strcpy (p, subst);