1 Star 0 Fork 57

yueryoufeng/vim

forked from src-openEuler/vim 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-CVE-2024-45306.patch 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
yueryoufeng 提交于 2024-09-03 09:27 +08:00 . fix CVE-2024-45306
From 396fd1ec2956307755392a1c61f55d5c1847f308 Mon Sep 17 00:00:00 2001
From: Christian Brabandt <cb@256bit.org>
Date: Sat, 31 Aug 2024 17:58:16 +0200
Subject: [PATCH] patch 9.1.0707: [security]: invalid cursor position may cause
a crash
Problem: [security]: invalid cursor position may cause a crash
(after v9.1.0038)
Solution: Set cursor to the last character in a line, if it would
otherwise point to beyond the line; no tests added, as it
is unclear how to reproduce this.
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-4ghr-c62x-cqfh
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
---
src/charset.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/charset.c b/src/charset.c
index bda3f91..ab4f1e4 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1621,6 +1621,9 @@ getvcol(
}
clear_chartabsize_arg(&cts);
+ if (*ptr == NUL && pos->col < MAXCOL && pos->col > ptr - line)
+ pos->col = ptr - line;
+
if (start != NULL)
*start = vcol + head;
if (end != NULL)
--
2.43.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yinyongkang/vim.git
git@gitee.com:yinyongkang/vim.git
yinyongkang
vim
vim
master

搜索帮助