X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=index-pack.c;h=64d75f8c4d592ce39d390ed6e89fa58b9374c68d;hb=fa257b0554d5cea91c2bba98c2017336e0890b36;hp=72e0962415d74c856917f6bb56e6fa2fea950c25;hpb=d1b2ddc8638357987ff3a658fe233ffa5ff2acee;p=git.git diff --git a/index-pack.c b/index-pack.c index 72e096241..64d75f8c4 100644 --- a/index-pack.c +++ b/index-pack.c @@ -457,7 +457,8 @@ static void parse_pack_objects(unsigned char *sha1) /* If input_fd is a file, we should have reached its end now. */ if (fstat(input_fd, &st)) die("cannot fstat packfile: %s", strerror(errno)); - if (S_ISREG(st.st_mode) && st.st_size != consumed_bytes) + if (S_ISREG(st.st_mode) && + lseek(input_fd, 0, SEEK_CUR) - input_len != st.st_size) die("pack has junk at the end"); if (!nr_deltas)