aboutsummaryrefslogtreecommitdiffstats
path: root/http-fetch.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-12-21 12:10:10 -0800
committerJunio C Hamano <junkio@cox.net>2005-12-21 12:13:53 -0800
commit455c161c47542de7e67d2ba48bba637e5a645388 (patch)
tree91b9dcb6a008e5f09c05d63a1ddf990c08781105 /http-fetch.c
parent21b1aced83195af50fd8bc9a88e7734c8ee77c0e (diff)
downloadgit-455c161c47542de7e67d2ba48bba637e5a645388.tar.gz
http-fetch.c: fix objects/info/pack parsing.
It failed to register the last pack in the objects/info/packs file. Also it had an independent overrun error. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'http-fetch.c')
-rw-r--r--http-fetch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/http-fetch.c b/http-fetch.c
index ad59f1cce6..3cd6ef91af 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -658,7 +658,7 @@ static int fetch_indices(struct alt_base *repo)
switch (data[i]) {
case 'P':
i++;
- if (i + 52 < buffer.posn &&
+ if (i + 52 <= buffer.posn &&
!strncmp(data + i, " pack-", 6) &&
!strncmp(data + i + 46, ".pack\n", 6)) {
get_sha1_hex(data + i + 6, sha1);
@@ -667,7 +667,7 @@ static int fetch_indices(struct alt_base *repo)
break;
}
default:
- while (data[i] != '\n')
+ while (i < buffer.posn && data[i] != '\n')
i++;
}
i++;