summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-19 05:06:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-19 05:06:03 (GMT)
commit7c10882c0d299b5d1dbe2c633e95c91ca6152197 (patch)
tree66819d4f283b0e6a1469329ceaed5d6ba0c76f2f
parentf85a051d13884c5a1059edb6ef7f2a6f8c55f0e9 (diff)
parentec099546a9afdb73b6bf39d5d684e6fb207e2a7f (diff)
downloadgit-7c10882c0d299b5d1dbe2c633e95c91ca6152197.zip
git-7c10882c0d299b5d1dbe2c633e95c91ca6152197.tar.gz
git-7c10882c0d299b5d1dbe2c633e95c91ca6152197.tar.bz2
Merge branch 'maint'
* maint: fetch-pack: check for valid commit from server
-rw-r--r--builtin/fetch-pack.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index 4367984..3c871c2 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -395,6 +395,8 @@ static int find_common(int fd[2], unsigned char *result_sha1,
case ACK_continue: {
struct commit *commit =
lookup_commit(result_sha1);
+ if (!commit)
+ die("invalid commit %s", sha1_to_hex(result_sha1));
if (args.stateless_rpc
&& ack == ACK_common
&& !(commit->object.flags & COMMON)) {