]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix segfault when doing a Verify job with compressed data
authorEric Bollengier <eric@baculasystems.com>
Mon, 7 Feb 2022 21:12:39 +0000 (22:12 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:57 +0000 (13:56 +0200)
bacula/src/filed/verify_vol.c

index ba0fd24948878985aafa634396c1dac81eda0b4b..64d3a36071a230f84c5a2efc01f189ba76e461b4 100644 (file)
@@ -309,6 +309,18 @@ void do_verify_volume(JCR *jcr)
    fdmsg->start_read_sock();
    bmessage *bmsg = fdmsg->new_msg(); /* get a message, to exchange with fdmsg */
 
+   if (have_zstd) {
+      ZSTD_DCtx *pZSTD = ZSTD_createDCtx();
+      jcr->ZSTD_decompress_workset = pZSTD;
+   }
+
+   if (have_lzo) {
+      if (lzo_init() != LZO_E_OK) {
+         Jmsg(jcr, M_FATAL, 0, _("LZO init failed\n"));
+         goto bail_out;
+      }
+   }
+
    /*
     * Get a record from the Storage daemon
     */