From: Junio C Hamano Date: Tue, 20 Jan 2009 00:44:08 +0000 (-0800) Subject: Fix reflog parsing for a malformed branch switching entry X-Git-Tag: v1.6.2-rc0~70^2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c829774c30e10473d3139edf92a4afe36e8abdc2;p=git.git 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 --- diff --git a/sha1_name.c b/sha1_name.c index 9d544a263..f54b6cb36 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;