From 7fae2985a32966da4fadde6a42669cd5364063d9 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 19 Aug 2013 17:44:16 +1000 Subject: [PATCH] merge: fix another bug in isolate_conflicts. In unusual cases we can fall off the end - better check. Signed-off-by: NeilBrown --- merge2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/merge2.c b/merge2.c index 50dd404..95a4ca2 100644 --- a/merge2.c +++ b/merge2.c @@ -376,7 +376,9 @@ int isolate_conflicts(struct file af, struct file bf, struct file cf, } while (j <= i) m[j++].in_conflict = 0; - out:; + out: + if (m[i].type == End) + break; } for (k = 1; k < m[i].al; k++) if (words || ends_line(af.list[m[i].a+k])) { -- 2.39.5