@matheusbsbs / matheus-bagliano / commits / c829774c30
Fork 0

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>

Junio C Hamano committed Jan 19, 2009 at 16:44 UTC c829774c30e10473d3139edf92a4afe36e8abdc2
1 file changed +1 -1
sha1_name.c
+1 -1
@@ -727,7 +727,7 @@ static int grab_nth_branch_switch(unsigned char *osha1, unsigned char *nsha1,
727 target += 4;
728 }
729
730 - if (!match)
730 + if (!match || !target)
731 return 0;
732
733 len = target - match - 4;