From: NeilBrown Date: Mon, 19 Aug 2013 07:44:16 +0000 (+1000) Subject: merge: fix another bug in isolate_conflicts. X-Git-Tag: v1.0~37 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=7fae2985a32966da4fadde6a42669cd5364063d9;p=wiggle.git merge: fix another bug in isolate_conflicts. In unusual cases we can fall off the end - better check. Signed-off-by: NeilBrown --- 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])) {