Patch 8.2.3678

5 views
Skip to first unread message

Bram Moolenaar

unread,
Nov 25, 2021, 3:40:47 PM11/25/21
to vim...@googlegroups.com

Patch 8.2.3678 (after 8.2.3677)
Problem: Illegal memory access.
Solution: Ignore changed indent when computing byte offset.
Files: src/register.c


*** ../vim-8.2.3677/src/register.c 2021-11-25 19:31:11.415905063 +0000
--- src/register.c 2021-11-25 20:37:31.651563438 +0000
***************
*** 2099,2104 ****
--- 2099,2105 ----
else
{
linenr_T new_lnum = new_cursor.lnum;
+ size_t len;

// Insert at least one line. When y_type is MCHAR, break the first
// line in two.
***************
*** 2211,2221 ****
// Put the '] mark on the first byte of the last inserted character.
// Correct the length for change in indent.
curbuf->b_op_end.lnum = new_lnum;
! col = (colnr_T)STRLEN(y_array[y_size - 1]) - lendiff;
if (col > 1)
curbuf->b_op_end.col = col - 1
- mb_head_off(y_array[y_size - 1],
! y_array[y_size - 1] + col - 1);
else
curbuf->b_op_end.col = 0;

--- 2212,2223 ----
// Put the '] mark on the first byte of the last inserted character.
// Correct the length for change in indent.
curbuf->b_op_end.lnum = new_lnum;
! len = STRLEN(y_array[y_size - 1]);
! col = (colnr_T)len - lendiff;
if (col > 1)
curbuf->b_op_end.col = col - 1
- mb_head_off(y_array[y_size - 1],
! y_array[y_size - 1] + len - 1);
else
curbuf->b_op_end.col = 0;

*** ../vim-8.2.3677/src/version.c 2021-11-25 19:31:11.419905059 +0000
--- src/version.c 2021-11-25 20:38:21.843511468 +0000
***************
*** 759,760 ****
--- 759,762 ----
{ /* Add new patch number below this line */
+ /**/
+ 3678,
/**/

--
Behold the warranty! The bold print giveth and the fine print taketh.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages