index-pack: always zero-initialize object_entry list
[gitweb.git] / builtin / index-pack.c
index 953dd3004e285ce7aa0432f4fe0eacb0d0c2c887..6922086376839e85ce43a5334ba67e18bb6f4c04 100644 (file)
@@ -1106,6 +1106,8 @@ static void conclude_pack(int fix_thin_pack, const char *curr_pack, unsigned cha
                objects = xrealloc(objects,
                                   (nr_objects + nr_unresolved + 1)
                                   * sizeof(*objects));
+               memset(objects + nr_objects + 1, 0,
+                      nr_unresolved * sizeof(*objects));
                f = sha1fd(output_fd, curr_pack);
                fix_unresolved_deltas(f, nr_unresolved);
                sprintf(msg, "completed with %d local objects",