]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix bdirjson segfault when the Catalog resource is set
authorEric Bollengier <eric@baculasystems.com>
Mon, 30 Nov 2020 09:53:20 +0000 (10:53 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:02:57 +0000 (09:02 +0100)
bacula/src/dird/bdirjson.c

index d9fd08aa5ad2445f971e85030c4f3a75a54e1f2d..475e3ba43146636056248ec01dace6e8399b4ef2 100644 (file)
@@ -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);