2 Star 0 Fork 53

openMajun/vim

forked from src-openEuler/vim 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-no-early-check-if-find-and-sfind-have-an-argument.patch 2.35 KB
一键复制 编辑 原始数据 按行查看 历史
shixuantong 提交于 2021-11-30 15:56 . fix CVE-2021-3973 CVE-2021-3974
From 2d10cd478047df8ba144d4b0fcc46480993af57f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <Bram@vim.org>
Date: Thu, 19 Mar 2020 14:37:30 +0100
Subject: [PATCH] patch 8.2.0407: no early check if :find and :sfind have an
argument
Problem: No early check if :find and :sfind have an argument.
Solution: Add EX_NEEDARG.
Reference:https://github.com/vim/vim/commit/2d10cd478047df8ba144d4b0fcc46480993af57f
---
src/ex_cmds.h | 4 ++--
src/testdir/test_find_complete.vim | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 983378c..28ea6ee 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -572,7 +572,7 @@ EXCMD(CMD_filter, "filter", ex_wrongmodifier,
EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM,
ADDR_NONE),
EXCMD(CMD_find, "find", ex_find,
- EX_RANGE|EX_BANG|EX_FILE1|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
+ EX_RANGE|EX_BANG|EX_FILE1|EX_CMDARG|EX_ARGOPT|EX_TRLBAR|EX_NEEDARG,
ADDR_OTHER),
EXCMD(CMD_finally, "finally", ex_finally,
EX_TRLBAR|EX_SBOXOK|EX_CMDWIN,
@@ -1319,7 +1319,7 @@ EXCMD(CMD_setlocal, "setlocal", ex_set,
EX_TRLBAR|EX_EXTRA|EX_CMDWIN|EX_SBOXOK,
ADDR_NONE),
EXCMD(CMD_sfind, "sfind", ex_splitview,
- EX_BANG|EX_FILE1|EX_RANGE|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
+ EX_BANG|EX_FILE1|EX_RANGE|EX_CMDARG|EX_ARGOPT|EX_TRLBAR|EX_NEEDARG,
ADDR_OTHER),
EXCMD(CMD_sfirst, "sfirst", ex_rewind,
EX_EXTRA|EX_BANG|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
diff --git a/src/testdir/test_find_complete.vim b/src/testdir/test_find_complete.vim
index 679bf3c..32ca967 100644
--- a/src/testdir/test_find_complete.vim
+++ b/src/testdir/test_find_complete.vim
@@ -15,22 +15,22 @@ func Test_find_complete()
new
set path=
- call assert_fails('call feedkeys(":find\t\n", "xt")', 'E345:')
+ call assert_fails('call feedkeys(":find \t\n", "xt")', 'E471:')
close
new
set path=.
- call assert_fails('call feedkeys(":find\t\n", "xt")', 'E32:')
+ call assert_fails('call feedkeys(":find \t\n", "xt")', 'E471:')
close
new
set path=.,,
- call assert_fails('call feedkeys(":find\t\n", "xt")', 'E32:')
+ call assert_fails('call feedkeys(":find \t\n", "xt")', 'E471:')
close
new
set path=./**
- call assert_fails('call feedkeys(":find\t\n", "xt")', 'E32:')
+ call assert_fails('call feedkeys(":find \t\n", "xt")', 'E471:')
close
" We shouldn't find any file till this point
--
2.23.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openMajun/vim.git
git@gitee.com:openMajun/vim.git
openMajun
vim
vim
master

搜索帮助