Skip to content

Commit

Permalink
Fix reflog parsing for a malformed branch switching entry
Browse files Browse the repository at this point in the history
target can be NULL when we failed to parse the message.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Jan 20, 2009
1 parent aa9c55b commit c829774
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sha1_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c829774

Please sign in to comment.