]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix segfault with new update packet
authorEric Bollengier <eric@baculasystems.com>
Wed, 25 May 2022 17:38:51 +0000 (19:38 +0200)
committerEric Bollengier <eric@baculasystems.com>
Fri, 27 May 2022 08:32:54 +0000 (10:32 +0200)
bacula/src/filed/crypto.c

index 0f626192aec62095ecfda563d261f9a054165ce8..f48be4e84e800761a006f96a6294266daf2ed9da 100644 (file)
@@ -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));