From 787880a86dbcb79cdf6e8241b1d99ac4a7acbc09 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 17 May 2019 20:17:40 +0200 Subject: [PATCH] patch 8.1.1342: using freed memory when joining line with text property Problem: Using freed memory when joining line with text property. Solution: Use already computed length. --- src/ops.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ops.c b/src/ops.c index d77aa2ef5..489c47354 100644 --- a/src/ops.c +++ b/src/ops.c @@ -4635,7 +4635,7 @@ do_join( { /* Set the '] mark. */ curwin->w_buffer->b_op_end.lnum = curwin->w_cursor.lnum; - curwin->w_buffer->b_op_end.col = (colnr_T)STRLEN(newp); + curwin->w_buffer->b_op_end.col = (colnr_T)sumsize; } /* Only report the change in the first line here, del_lines() will report diff --git a/src/version.c b/src/version.c index f9329ba8c..07db364bf 100644 --- a/src/version.c +++ b/src/version.c @@ -767,6 +767,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1342, /**/ 1341, /**/ -- 2.40.0