From 3c7939fe2bc71876feb1b5c144e95c69f60d2763 Mon Sep 17 00:00:00 2001 From: Christian Weisgerber Date: Sat, 16 Oct 2021 15:01:42 +0000 Subject: [PATCH] fix another segfault in edscript() Same problem as fixed in 90de04bc7f1b85b9c491bcd124f6178fad005de1. ok stsp --- lib/diff3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/diff3.c b/lib/diff3.c index 899e70b0..ecf2b806 100644 --- a/lib/diff3.c +++ b/lib/diff3.c @@ -1047,7 +1047,7 @@ edscript(int n, struct diff3_state *d3s) goto done; } else { err = diff_output(d3s->diffbuf, "%s%s\n.\n", - line[linelen] == '\n' ? ":" : "", + linelen > 0 && line[linelen] == '\n' ? ":" : "", d3s->f3mark); if (err) goto done; -- 2.11.4.GIT