From: Eric Bollengier Date: Mon, 5 Dec 2011 08:24:45 +0000 (+0100) Subject: Fix segfault in accurate code X-Git-Tag: Release-7.0.0~411 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=282f42a77cc3852d67657e588a071a27d985b84b;p=bacula%2Fbacula Fix segfault in accurate code This segfault was introduced while cleaning the code. --- diff --git a/bacula/src/filed/accurate.c b/bacula/src/filed/accurate.c index 3a043a3997..3479cd5eca 100644 --- a/bacula/src/filed/accurate.c +++ b/bacula/src/filed/accurate.c @@ -212,8 +212,10 @@ static bool accurate_add_file(JCR *jcr, uint32_t len, bool ret = true; CurFile *item; - /* we store CurFile, fname and ctime/mtime in the same chunk */ - item = (CurFile *)jcr->file_list->hash_malloc(sizeof(CurFile)+len); + /* we store CurFile, fname and ctime/mtime in the same chunk + * we need some extra bytes to handle an empty chksum + */ + item = (CurFile *)jcr->file_list->hash_malloc(sizeof(CurFile)+len+3); item->seen = 0; /* TODO: see if we can optimize this part with memcpy instead of strcpy */