summaryrefslogtreecommitdiff
path: root/rerere.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-11-21 22:57:44 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-11-21 22:57:44 +0900
commitb4eafbcdb84fc406bff37f06fdf6310aca7d0249 (patch)
tree89f6f96f46f64695ac84ad9a49e14017e573ef77 /rerere.c
parentMerge branch 'js/mingw-o-append' into maint (diff)
parentrerere: avoid buffer overrun (diff)
downloadtgif-b4eafbcdb84fc406bff37f06fdf6310aca7d0249.tar.xz
Merge branch 'en/rerere-multi-stage-1-fix' into maint
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 c7787aa07f..783d4dae2a 100644
--- a/rerere.c
+++ b/rerere.c
@@ -533,7 +533,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 */