X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=http-fetch.c;h=3cd6ef91af59fdb42a664cb8d9bdb5b591ecb789;hb=724b511d4fb363ebee828ba3992c831ba006444c;hp=ad59f1cce61d73fa832828aabb880f082debf94d;hpb=9cac9d368934f68e75810df95211a6522d4d139e;p=git.git 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++;