• R/O
  • SSH

vim: コミット

Mirror of the Vim source from https://github.com/vim/vim


コミットメタ情報

リビジョンba835881a79e9fcdb6a56c060fb297a0ae309652 (tree)
日時2021-11-26 05:45:03
作者Bram Moolenaar <Bram@vim....>
コミッターBram Moolenaar

ログメッセージ

patch 8.2.3678: illegal memory access

Commit: https://github.com/vim/vim/commit/85be8563fe5aff686e9e30d6afff401ccd976f2a
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 25 20:40:11 2021 +0000

patch 8.2.3678: illegal memory access
Problem: Illegal memory access.
Solution: Ignore changed indent when computing byte offset.

変更サマリ

差分

diff -r 0324433f1750 -r ba835881a79e src/register.c
--- a/src/register.c Thu Nov 25 20:45:04 2021 +0100
+++ b/src/register.c Thu Nov 25 21:45:03 2021 +0100
@@ -2099,6 +2099,7 @@
20992099 else
21002100 {
21012101 linenr_T new_lnum = new_cursor.lnum;
2102+ size_t len;
21022103
21032104 // Insert at least one line. When y_type is MCHAR, break the first
21042105 // line in two.
@@ -2211,11 +2212,12 @@
22112212 // Put the '] mark on the first byte of the last inserted character.
22122213 // Correct the length for change in indent.
22132214 curbuf->b_op_end.lnum = new_lnum;
2214- col = (colnr_T)STRLEN(y_array[y_size - 1]) - lendiff;
2215+ len = STRLEN(y_array[y_size - 1]);
2216+ col = (colnr_T)len - lendiff;
22152217 if (col > 1)
22162218 curbuf->b_op_end.col = col - 1
22172219 - mb_head_off(y_array[y_size - 1],
2218- y_array[y_size - 1] + col - 1);
2220+ y_array[y_size - 1] + len - 1);
22192221 else
22202222 curbuf->b_op_end.col = 0;
22212223
diff -r 0324433f1750 -r ba835881a79e src/version.c
--- a/src/version.c Thu Nov 25 20:45:04 2021 +0100
+++ b/src/version.c Thu Nov 25 21:45:03 2021 +0100
@@ -758,6 +758,8 @@
758758 static int included_patches[] =
759759 { /* Add new patch number below this line */
760760 /**/
761+ 3678,
762+/**/
761763 3677,
762764 /**/
763765 3676,
旧リポジトリブラウザで表示