Browse Source

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>
maint
Junio C Hamano 16 years ago
parent
commit
c829774c30
  1. 2
      sha1_name.c

2
sha1_name.c

@ -727,7 +727,7 @@ static int grab_nth_branch_switch(unsigned char *osha1, unsigned char *nsha1, @@ -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;

Loading…
Cancel
Save