Skip to content

Commit 7c10882

Browse files
committed
Merge branch 'maint'
* maint: fetch-pack: check for valid commit from server
2 parents f85a051 + ec09954 commit 7c10882

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/fetch-pack.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,8 @@ static int find_common(int fd[2], unsigned char *result_sha1,
395395
case ACK_continue: {
396396
struct commit *commit =
397397
lookup_commit(result_sha1);
398+
if (!commit)
399+
die("invalid commit %s", sha1_to_hex(result_sha1));
398400
if (args.stateless_rpc
399401
&& ack == ACK_common
400402
&& !(commit->object.flags & COMMON)) {

0 commit comments

Comments
 (0)