]> git.sur5r.net Git - bacula/bacula/commitdiff
Attempt to fix bug #2237
authorKern Sibbald <kern@sibbald.com>
Mon, 12 Sep 2016 11:56:01 +0000 (13:56 +0200)
committerKern Sibbald <kern@sibbald.com>
Mon, 12 Sep 2016 11:56:01 +0000 (13:56 +0200)
bacula/src/cats/mysql.c
bacula/src/cats/postgresql.c
bacula/src/cats/sqlite.c
bacula/src/dird/catreq.c

index 52546b7dd4e0d201a99453883504ecbeb78b34b8..529e6c55c3707dc1967aff9a0f101f9814846eb9 100644 (file)
@@ -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));
    } 
 } 
  
index 51d1a13fedd50ae500fb0592f0e390ff0244481a..6794b4ae74c907f7c53e819b3eef82edc605a491 100644 (file)
@@ -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));
    }
 
    /* 
index 7dcbafe7f0258406f2c0c84205e7cc80d228d708..9ee817102167d8f8683cf5c25ddbd623593b58bc 100644 (file)
@@ -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) { 
index d7341adeb4eb4741be0072d3618840662948ce25..ed0a736784f754a8078f63770803d1bafc16d580 100644 (file)
@@ -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;