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>
This commit is contained in:
Junio C Hamano 2009-01-19 16:44:08 -08:00
parent aa9c55b667
commit c829774c30

View file

@ -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;