summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2008-08-29 16:07:59 -0400
committerJunio C Hamano <gitster@pobox.com>2008-08-29 21:51:27 -0700
commitabeb40e5aa5b4a39799ae1caad241c8c7708053a (patch)
tree6fb35911f6750230ade15c390256bb237f5e0019 /fast-import.c
parent6ed7f25e95069a900b10f838b15639af3fac05d3 (diff)
downloadgit-abeb40e5aa5b4a39799ae1caad241c8c7708053a.tar.gz
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 <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fast-import.c b/fast-import.c
index 7089e6f9e6..d85b3a561f 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -951,7 +951,8 @@ static void end_packfile(void)
close_pack_windows(pack_data);
fixup_pack_header_footer(pack_data->pack_fd, pack_data->sha1,
- pack_data->pack_name, object_count);
+ pack_data->pack_name, object_count,
+ NULL, 0);
close(pack_data->pack_fd);
idx_name = keep_pack(create_index());