From: Eric Bollengier Date: Mon, 30 Nov 2020 09:53:20 +0000 (+0100) Subject: Fix bdirjson segfault when the Catalog resource is set X-Git-Tag: Release-11.3.2~974 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e01b29d84517487741174850e899d134a5fc00f3;p=thirdparty%2Fbacula.git Fix bdirjson segfault when the Catalog resource is set --- diff --git a/bacula/src/dird/bdirjson.c b/bacula/src/dird/bdirjson.c index d9fd08aa5..475e3ba43 100644 --- a/bacula/src/dird/bdirjson.c +++ b/bacula/src/dird/bdirjson.c @@ -1183,6 +1183,9 @@ static bool check_resources(bool apply_jobdefs) OK = false; } } + if (!director->catalog) { /* If catalog message resource not specified */ + director->catalog = (CAT *)GetNextRes(R_CATALOG, NULL); + } if (GetNextRes(R_DIRECTOR, (RES *)director) != NULL) { Jmsg(NULL, M_FATAL, 0, _("Only one Director resource permitted in %s\n"), configfile);