summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2020-03-18 09:15:59 +0000
committerPhilip Withnall <withnall@endlessm.com>2020-03-18 09:15:59 +0000
commitea64c739239faea463f3cb9154a12cc4532ba525 (patch)
tree92328d40533a1eed32d487ceb612ddc4fd5a1e60
parentcc2afef13efd12ac57c2de32bdc1b5b3c923f60c (diff)
downloadgvdb-ea64c739239faea463f3cb9154a12cc4532ba525.tar.gz
gvdb-builder: Initialise some memory to zero in the bloom filter
Until a bloom filter is implemented, we need to ensure that all the memory returned by `file_builder_allocate()` is initialised, since it’s not initialised at allocation time. Signed-off-by: Philip Withnall <withnall@endlessm.com> Fixes: #2
-rw-r--r--gvdb-builder.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gvdb-builder.c b/gvdb-builder.c
index 3942667..b8ecbe3 100644
--- a/gvdb-builder.c
+++ b/gvdb-builder.c
@@ -339,6 +339,8 @@ file_builder_allocate_for_hash (FileBuilder *fb,
#undef chunk
memset (*bloom_filter, 0, n_bloom_words * sizeof (guint32_le));
+ memset (*hash_buckets, 0, n_buckets * sizeof (guint32_le));
+ memset (*hash_items, 0, n_items * sizeof (struct gvdb_hash_item));
/* NOTE - the code to actually fill in the bloom filter here is missing.
* Patches welcome!