From: Junio C Hamano Date: Wed, 21 Dec 2005 20:10:10 +0000 (-0800) Subject: http-fetch.c: fix objects/info/pack parsing. X-Git-Tag: v1.0.0a~3 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=455c161c47542de7e67d2ba48bba637e5a645388;p=git.git 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 --- diff --git a/http-fetch.c b/http-fetch.c index ad59f1cc..3cd6ef91 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++;