Commits

Junio C Hamano  committed 455c161

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>

  • Participants
  • Parent commits 21b1ace

Comments (0)

Files changed (1)

File http-fetch.c

 		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);
 				break;
 			}
 		default:
-			while (data[i] != '\n')
+			while (i < buffer.posn && data[i] != '\n')
 				i++;
 		}
 		i++;