summaryrefslogtreecommitdiff
path: root/rerere.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-09-24 17:30:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-09-24 17:30:48 (GMT)
commitbd3941a0aed0756aba43f504d0dea7a3fbe0c82b (patch)
tree17d9c22f6491f77904aa727ccfc833c9150d441b /rerere.c
parente3d4ff037db41234eaf74167ab7d1a443c23243d (diff)
parentad2bf0d9b43433583e88128c278ce31c7ca4e431 (diff)
downloadgit-bd3941a0aed0756aba43f504d0dea7a3fbe0c82b.zip
git-bd3941a0aed0756aba43f504d0dea7a3fbe0c82b.tar.gz
git-bd3941a0aed0756aba43f504d0dea7a3fbe0c82b.tar.bz2
Merge branch 'en/rerere-multi-stage-1-fix'
A corner case bugfix in "git rerere" code. * en/rerere-multi-stage-1-fix: rerere: avoid buffer overrun t4200: demonstrate rerere segfault on specially crafted merge
Diffstat (limited to 'rerere.c')
-rw-r--r--rerere.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rerere.c b/rerere.c
index 2fd3181..7aa149e 100644
--- a/rerere.c
+++ b/rerere.c
@@ -521,7 +521,7 @@ static int check_one_conflict(int i, int *type)
}
*type = PUNTED;
- while (ce_stage(active_cache[i]) == 1)
+ while (i < active_nr && ce_stage(active_cache[i]) == 1)
i++;
/* Only handle regular files with both stages #2 and #3 */