From: Bram Moolenaar Date: Fri, 17 May 2019 18:17:40 +0000 (+0200) Subject: patch 8.1.1342: using freed memory when joining line with text property X-Git-Tag: v8.1.1342 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=787880a86dbcb79cdf6e8241b1d99ac4a7acbc09;p=vim 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. --- 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, /**/