From abeb40e5aa5b4a39799ae1caad241c8c7708053a Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Fri, 29 Aug 2008 16:07:59 -0400 Subject: improve reliability of fixup_pack_header_footer() Currently, this function has the potential to read corrupted pack data from disk and give it a valid SHA1 checksum. Let's add the ability to validate SHA1 checksum of existing data along the way, including before and after any arbitrary point in the pack. Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- index-pack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'index-pack.c') diff --git a/index-pack.c b/index-pack.c index 728af7da9..411b80d81 100644 --- a/index-pack.c +++ b/index-pack.c @@ -982,7 +982,8 @@ int main(int argc, char **argv) nr_objects - nr_objects_initial); stop_progress_msg(&progress, msg); fixup_pack_header_footer(output_fd, sha1, - curr_pack, nr_objects); + curr_pack, nr_objects, + NULL, 0); } if (nr_deltas != nr_resolved_deltas) die("pack has %d unresolved deltas", -- cgit v1.2.1