summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-17 20:17:40 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-17 20:17:40 +0200
commit787880a86dbcb79cdf6e8241b1d99ac4a7acbc09 (patch)
tree3c486f6ec9d5f45e52c2b6b26df957a9723bf951
parent80e737cc6ab6b68948f6765348b6881be861b200 (diff)
downloadvim-git-787880a86dbcb79cdf6e8241b1d99ac4a7acbc09.tar.gz
patch 8.1.1342: using freed memory when joining line with text propertyv8.1.1342
Problem: Using freed memory when joining line with text property. Solution: Use already computed length.
-rw-r--r--src/ops.c2
-rw-r--r--src/version.c2
2 files changed, 3 insertions, 1 deletions
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
@@ -768,6 +768,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1342,
+/**/
1341,
/**/
1340,