From 94a605687f85c171057aa112aa41f25993ce36f2 Mon Sep 17 00:00:00 2001 From: Bill Blough Date: Tue, 10 Oct 2017 22:03:34 -0400 Subject: [PATCH] Add null pointer check to correct issue #3 --- src/dotconf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dotconf.c b/src/dotconf.c index 7ba2001..2f7b129 100644 --- a/src/dotconf.c +++ b/src/dotconf.c @@ -1457,6 +1457,13 @@ DOTCONF_CB(dotconf_cb_include) char *pre = 0; char *ext = 0; + if (!cmd->data.str) { + dotconf_warning(cmd->configfile, DCLOG_WARNING, + ERR_INCLUDE_ERROR, + "Invalid or missing filename"); + return NULL; + } + if (cmd->configfile->includepath && cmd->data.str[0] != '/' && cmd->configfile->includepath[0] != '\0') {