From: Kern Sibbald Date: Mon, 12 Sep 2016 11:56:01 +0000 (+0200) Subject: Attempt to fix bug #2237 X-Git-Tag: Release-7.4.4~20 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9136ed1c83211addea0d1ad9d5ff682ae729a039;p=bacula%2Fbacula Attempt to fix bug #2237 --- diff --git a/bacula/src/cats/mysql.c b/bacula/src/cats/mysql.c index 52546b7dd4..529e6c55c3 100644 --- a/bacula/src/cats/mysql.c +++ b/bacula/src/cats/mysql.c @@ -443,6 +443,7 @@ void BDB_MYSQL::bdb_start_transaction(JCR *jcr) } if (!jcr->ar) { jcr->ar = (ATTR_DBR *)malloc(sizeof(ATTR_DBR)); + memset(jcr->ar, 0, sizeof(ATTR_DBR)); } } diff --git a/bacula/src/cats/postgresql.c b/bacula/src/cats/postgresql.c index 51d1a13fed..6794b4ae74 100644 --- a/bacula/src/cats/postgresql.c +++ b/bacula/src/cats/postgresql.c @@ -445,6 +445,7 @@ void BDB_POSTGRESQL::bdb_start_transaction(JCR *jcr) } if (!jcr->ar) { jcr->ar = (ATTR_DBR *)malloc(sizeof(ATTR_DBR)); + memset(jcr->ar, 0, sizeof(ATTR_DBR)); } /* diff --git a/bacula/src/cats/sqlite.c b/bacula/src/cats/sqlite.c index 7dcbafe7f0..9ee8171021 100644 --- a/bacula/src/cats/sqlite.c +++ b/bacula/src/cats/sqlite.c @@ -378,6 +378,7 @@ void BDB_SQLITE::bdb_start_transaction(JCR *jcr) } if (!jcr->ar) { jcr->ar = (ATTR_DBR *)malloc(sizeof(ATTR_DBR)); + memset(jcr->ar, 0, sizeof(ATTR_DBR)); } if (!mdb->m_allow_transactions) { diff --git a/bacula/src/dird/catreq.c b/bacula/src/dird/catreq.c index d7341adeb4..ed0a736784 100644 --- a/bacula/src/dird/catreq.c +++ b/bacula/src/dird/catreq.c @@ -612,9 +612,13 @@ static void update_attribute(JCR *jcr, char *msg, int32_t msglen) Stream); } - bin_to_base64(digestbuf, sizeof(digestbuf), fname, len, true); - Dmsg3(400, "DigestLen=%d Digest=%s type=%d\n", strlen(digestbuf), - digestbuf, Stream); + if (len != 0) { + bin_to_base64(digestbuf, sizeof(digestbuf), fname, len, true); + Dmsg3(400, "DigestLen=%d Digest=%s type=%d\n", strlen(digestbuf), + digestbuf, Stream); + } else { + digestbuf[0] = 0; + } if (jcr->cached_attribute) { ar->Digest = digestbuf; ar->DigestType = type;