From: Eric Bollengier Date: Mon, 7 Feb 2022 21:12:39 +0000 (+0100) Subject: Fix segfault when doing a Verify job with compressed data X-Git-Tag: Beta-15.0.0~650 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77853189ae0e4bfb416a8500e3c3096bb54dea24;p=thirdparty%2Fbacula.git Fix segfault when doing a Verify job with compressed data --- diff --git a/bacula/src/filed/verify_vol.c b/bacula/src/filed/verify_vol.c index ba0fd2494..64d3a3607 100644 --- a/bacula/src/filed/verify_vol.c +++ b/bacula/src/filed/verify_vol.c @@ -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 */