summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sha1_name.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sha1_name.c b/sha1_name.c
index 9d544a2633..f54b6cb36a 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -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;