Skip to content

Commit c829774

Browse files
committed
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 <[email protected]>
1 parent aa9c55b commit c829774

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sha1_name.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ static int grab_nth_branch_switch(unsigned char *osha1, unsigned char *nsha1,
727727
target += 4;
728728
}
729729

730-
if (!match)
730+
if (!match || !target)
731731
return 0;
732732

733733
len = target - match - 4;

0 commit comments

Comments
 (0)