Skip to content

Commit

Permalink
http-fetch.c: fix objects/info/pack parsing.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Dec 21, 2005
1 parent 21b1ace commit 455c161
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions http-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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++;
Expand Down

0 comments on commit 455c161

Please sign in to comment.