From 0ed859fc5632673a4fbcd69430409f2d07de02ed Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 16 Sep 2008 13:32:18 +0000 Subject: [PATCH] Fix bug #1156 FD crash during processing of Accurate data. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7600 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/filed/job.c | 2 +- bacula/src/lib/htable.c | 2 ++ bacula/technotes-2.5 | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 0c21ffe558..98f7318184 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -749,7 +749,7 @@ static void add_fileset(JCR *jcr, const char *item) */ if (subcode != ' ') { state = state_error; - Dmsg0(100, "Set state=error\n"); + Dmsg0(100, "Set state=error or double code.\n"); } switch (code) { case 'I': diff --git a/bacula/src/lib/htable.c b/bacula/src/lib/htable.c index d2877d43f0..f04fa55c8e 100644 --- a/bacula/src/lib/htable.c +++ b/bacula/src/lib/htable.c @@ -227,12 +227,14 @@ void htable::grow_table() Dmsg1(100, "Grow called old size = %d\n", buckets); /* Setup a bigger table */ htable *big = (htable *)malloc(sizeof(htable)); + memcpy(big, this, sizeof(htable)); /* start with original class data */ big->loffset = loffset; big->mask = mask<<1 | 1; big->rshift = rshift - 1; big->num_items = 0; big->buckets = buckets * 2; big->max_items = big->buckets * 4; + /* Create a bigger hash table */ big->table = (hlink **)malloc(big->buckets * sizeof(hlink *)); memset(big->table, 0, big->buckets * sizeof(hlink *)); big->walkptr = NULL; diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 86cc37cce1..e82a74405d 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -19,6 +19,7 @@ remove reader/writer in FOPTS???? General: 16Sep08 +kes Fix bug #1156 FD crash during processing of Accurate data. kes Tweaks to htable code to improved debugging and make names a bit more meaningful. 15Sep08 -- 2.39.5