From ccce64485b0dda68fff780bfe325ee8ec40eb9cb Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 17 Sep 2009 16:21:03 +0200 Subject: [PATCH] Fix seg fault in ignoredir code --- bacula/src/findlib/find_one.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bacula/src/findlib/find_one.c b/bacula/src/findlib/find_one.c index f4f2e7be80..36cfa6c8b8 100644 --- a/bacula/src/findlib/find_one.c +++ b/bacula/src/findlib/find_one.c @@ -303,7 +303,13 @@ static bool have_ignoredir(FF_PKT *ff_pkt) { struct stat sb; char tmp_name[MAXPATHLEN]; - char *ignoredir = ff_pkt->fileset->incexe->ignoredir; + char *ignoredir; + + /* Ensure that pointers are defined */ + if (!ff_pkt->fileset || !ff_pkt->fileset->incexe) { + return false; + } + ignoredir = ff_pkt->fileset->incexe->ignoredir; if (ignoredir) { if (strlen(ff_pkt->fname) + strlen(ignoredir) + 2 > MAXPATHLEN) { -- 2.39.5