From: Eric Bollengier Date: Wed, 25 May 2022 17:38:51 +0000 (+0200) Subject: Fix segfault with new update packet X-Git-Tag: Release-13.0.0~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=527136abee676cbcf57f27e1112655e9491aa071;p=thirdparty%2Fbacula.git Fix segfault with new update packet --- diff --git a/bacula/src/filed/crypto.c b/bacula/src/filed/crypto.c index 0f626192a..f48be4e84 100644 --- a/bacula/src/filed/crypto.c +++ b/bacula/src/filed/crypto.c @@ -262,7 +262,7 @@ bool crypto_terminate_digests(bctx_t &bctx) } /** Terminate any digest and send it to Storage daemon */ - if (bctx.digest || ff_pkt->stat_update) { + if (bctx.digest || (ff_pkt->stat_update && ff_pkt->accurate_chksum)) { uint32_t size; sd->fsend("%ld %d 0", jcr->JobFiles, bctx.digest_stream); @@ -275,7 +275,7 @@ bool crypto_terminate_digests(bctx_t &bctx) sd->msg = realloc_pool_memory(sd->msg, size); } - if (ff_pkt->stat_update) { + if (ff_pkt->stat_update && ff_pkt->accurate_chksum) { /* The checksum comes from the accurate table and the format is in base64 */ size = base64_to_bin(sd->msg, sizeof_pool_memory(sd->msg), ff_pkt->accurate_chksum, strlen(ff_pkt->accurate_chksum));