summaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-19 16:44:08 -0800
committerJunio C Hamano <gitster@pobox.com>2009-01-19 16:44:17 -0800
commitc829774c30e10473d3139edf92a4afe36e8abdc2 (patch)
tree56d1ee23eb493db09741cf2ddf284a348e8a8c11 /sha1_name.c
parentaa9c55b66719c86896d134d35de8c263c078a481 (diff)
downloadgit-c829774c30e10473d3139edf92a4afe36e8abdc2.tar.gz
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>
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sha1_name.c b/sha1_name.c
index 9d544a2633..f54b6cb36a 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;