Fix reflog parsing for a malformed branch switching entry
authorJunio C Hamano <gitster@pobox.com>
Tue, 20 Jan 2009 00:44:08 +0000 (16:44 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Jan 2009 00:44:17 +0000 (16:44 -0800)
target can be NULL when we failed to parse the message.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c

index 9d544a2..f54b6cb 100644 (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;