]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Avoid segfault in metaplugin when the plugin command is simplified
authorEric Bollengier <eric@baculasystems.com>
Wed, 16 Mar 2022 17:33:32 +0000 (18:33 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:28 +0000 (09:03 +0100)
bacula/src/plugins/fd/pluginlib/metaplugin.cpp

index 499a2e985108875d8d942ca823de15d82dfa2af8..269e11694d559ec421fc0956c3f8024265a02aeb 100644 (file)
@@ -2229,6 +2229,10 @@ bRC METAPLUGIN::startBackupFile(bpContext *ctx, struct save_pkt *sp)
    POOL_MEM cmd(PM_FNAME);
    int reqparams = 2;
 
+   if (backend.is_ctx_null()) {
+      JMSG0(ctx, M_FATAL, "Unable to use the backend properly\n");
+      return bRC_Error;
+   }
    if (job_cancelled) {
       return bRC_Error;
    }