summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2020-03-18 10:42:36 -0500
committerMichael Catanzaro <mcatanzaro@gnome.org>2020-03-18 10:42:36 -0500
commit8bf2b6744ee6626e95ad80fdacda7f8ae044b828 (patch)
tree3760f2198d732f1c002afdbeb36165b476e4213d
parent11cc9449213cba5808cf71bd92aecbafa53c8c27 (diff)
downloadepiphany-8bf2b6744ee6626e95ad80fdacda7f8ae044b828.tar.gz
gvdb: fix uninitialized memory writes
-rw-r--r--lib/contrib/gvdb/README.epiphany4
-rw-r--r--lib/contrib/gvdb/gvdb-builder.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/contrib/gvdb/README.epiphany b/lib/contrib/gvdb/README.epiphany
index f31049b2f..638f796f4 100644
--- a/lib/contrib/gvdb/README.epiphany
+++ b/lib/contrib/gvdb/README.epiphany
@@ -6,5 +6,5 @@ GVariant Database
* Add clang ifdef guards (#ifndef __clang_analyzer__) around:
- file_builder_allocate_for_hash
- file_builder_add_hash
-
- * Removed G_FILE_CREATE_REPLACE_DESTINATION in gvdb_table_write_contents_async \ No newline at end of file
+ * Removed G_FILE_CREATE_REPLACE_DESTINATION in gvdb_table_write_contents_async
+ * Fix valgrind warnings (gvdb#2)
diff --git a/lib/contrib/gvdb/gvdb-builder.c b/lib/contrib/gvdb/gvdb-builder.c
index 0ac6db01f..5f59e7cb3 100644
--- a/lib/contrib/gvdb/gvdb-builder.c
+++ b/lib/contrib/gvdb/gvdb-builder.c
@@ -340,6 +340,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!