]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/accurate.c
Fix segfault in accurate code
[bacula/bacula] / bacula / src / filed / accurate.c
index 3a043a399756e224281ecc5103f34dede3db3d10..3479cd5ecaa5cbf74253c8c73be95a77d31c819f 100644 (file)
@@ -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 */