]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix org#2658 About segfault with bsdjson with incorrect parameters
authorEric Bollengier <eric@baculasystems.com>
Tue, 3 May 2022 13:14:59 +0000 (15:14 +0200)
committerEric Bollengier <eric@baculasystems.com>
Tue, 3 May 2022 13:35:19 +0000 (15:35 +0200)
bacula/src/stored/bsdjson.c

index f588616882a2a5bd6886dd68b07e2c2c9cdad5e3..457052218562d52997ce2268c9cef123a02d61e0 100644 (file)
@@ -589,7 +589,7 @@ static int check_resources()
       OK = false;
    }
 
-   if (!me->messages) {
+   if (me && !me->messages) {
       me->messages = (MSGS *)GetNextRes(R_MSGS, NULL);
       if (!me->messages) {
          Jmsg1(NULL, M_ERROR, 0, _("No Messages resource defined in %s. Cannot continue.\n"),
@@ -598,7 +598,7 @@ static int check_resources()
       }
    }
 
-   if (!me->working_directory) {
+   if (me && !me->working_directory) {
       Jmsg1(NULL, M_ERROR, 0, _("No Working Directory defined in %s. Cannot continue.\n"),
          configfile);
       OK = false;