diff options
author | Nicolas Pitre <nico@cam.org> | 2008-08-29 22:07:59 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-30 06:51:27 +0200 |
commit | abeb40e5aa5b4a39799ae1caad241c8c7708053a (patch) | |
tree | 6fb35911f6750230ade15c390256bb237f5e0019 /builtin-pack-objects.c | |
parent | pack-objects: improve returned information from write_one() (diff) | |
download | git-abeb40e5aa5b4a39799ae1caad241c8c7708053a.tar.xz git-abeb40e5aa5b4a39799ae1caad241c8c7708053a.zip |
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 'builtin-pack-objects.c')
-rw-r--r-- | builtin-pack-objects.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index 640e05a12e..501f9367cb 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -493,7 +493,8 @@ static void write_pack_file(void) sha1close(f, sha1, CSUM_FSYNC); } else { int fd = sha1close(f, NULL, 0); - fixup_pack_header_footer(fd, sha1, pack_tmp_name, nr_written); + fixup_pack_header_footer(fd, sha1, pack_tmp_name, + nr_written, NULL, 0); close(fd); } |