# HG changeset patch # User Bram Moolenaar # Date 1558117806 -7200 # Node ID c263acbbd961266fbe3f4ba8f76f473eca076a28 # Parent 86d8068ffedafecbb170af7ed0914827ab0a76cf patch 8.1.1342: using freed memory when joining line with text property commit https://github.com/vim/vim/commit/787880a86dbcb79cdf6e8241b1d99ac4a7acbc09 Author: Bram Moolenaar Date: Fri May 17 20:17:40 2019 +0200 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 --- 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 --- a/src/version.c +++ b/src/version.c @@ -768,6 +768,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1342, +/**/ 1341, /**/ 1340,