1 Star 0 Fork 52

willwolf/vim

forked from src-openEuler/vim 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-CVE-2023-1175.patch 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
wjiang 提交于 2023-03-08 01:17 . fix CVE-2023-1170 CVE-2023-1175
From c99cbf8f289bdda5d4a77d7ec415850a520330ba Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <Bram@vim.org>
Date: Sat, 4 Mar 2023 14:13:10 +0000
Subject: [PATCH] patch 9.0.1378: illegal memory access when using virtual
editing
Problem: Illegal memory access when using virtual editing.
Solution: Make sure "startspaces" is not negative.
---
src/register.c | 2 ++
src/testdir/test_virtualedit.vim | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/src/register.c b/src/register.c
index 461363be378d..f3df79cfd642 100644
--- a/src/register.c
+++ b/src/register.c
@@ -1247,6 +1247,8 @@ op_yank(oparg_T *oap, int deleting, int mess)
// double-count it.
bd.startspaces = (ce - cs + 1)
- oap->start.coladd;
+ if (bd.startspaces < 0)
+ bd.startspaces = 0;
startcol++;
}
}
diff --git a/src/testdir/test_virtualedit.vim b/src/testdir/test_virtualedit.vim
index 71cea427bac1..edaae678609d 100644
--- a/src/testdir/test_virtualedit.vim
+++ b/src/testdir/test_virtualedit.vim
@@ -88,6 +88,16 @@ func Test_edit_change()
set virtualedit=
endfunc
+func Test_edit_special_char()
+ new
+ se ve=all
+ norm a0
+ sil! exe "norm o00000\<Nul>k<a0s"
+
+ bwipe!
+ set virtualedit=
+endfunc
+
" Tests for pasting at the beginning, end and middle of a tab character
" in virtual edit mode.
func Test_paste_in_tab()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/willwolf/vim.git
git@gitee.com:willwolf/vim.git
willwolf
vim
vim
master

搜索帮助