summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-20 00:44:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-01-20 00:44:17 (GMT)
commitc829774c30e10473d3139edf92a4afe36e8abdc2 (patch)
tree56d1ee23eb493db09741cf2ddf284a348e8a8c11
parentaa9c55b66719c86896d134d35de8c263c078a481 (diff)
downloadgit-c829774c30e10473d3139edf92a4afe36e8abdc2.zip
git-c829774c30e10473d3139edf92a4afe36e8abdc2.tar.gz
git-c829774c30e10473d3139edf92a4afe36e8abdc2.tar.bz2
Fix reflog parsing for a malformed branch switching entry
target can be NULL when we failed to parse the message. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--sha1_name.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sha1_name.c b/sha1_name.c
index 9d544a2..f54b6cb 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -727,7 +727,7 @@ static int grab_nth_branch_switch(unsigned char *osha1, unsigned char *nsha1,
target += 4;
}
- if (!match)
+ if (!match || !target)
return 0;
len = target - match - 4;