1 Star 0 Fork 58

ren_deqi/vim

forked from src-openEuler/vim 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-patch-9.0.0024-may-access-part-of-typeahead-buf-that-is-not-filled.patch 953 Bytes
一键复制 编辑 原始数据 按行查看 历史
wjiang 提交于 2023-02-22 11:10 +08:00 . backport upstream patch to fix memory leak
From af043e12d9e5869c597de40b9a2517ae97ac72e7 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <Bram@vim.org>
Date: Sat, 2 Jul 2022 12:08:16 +0100
Subject: [PATCH] patch 9.0.0024: may access part of typeahead buf that isn't
filled
Problem: May access part of typeahead buf that isn't filled.
Solution: Check length of typeahead.
---
src/getchar.c | 3 ++-
files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/getchar.c b/src/getchar.c
index 210a67acad59..12fd1c9146b3 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -2437,7 +2437,8 @@ handle_mapping(
int is_plug_map = FALSE;
// If typehead starts with <Plug> then remap, even for a "noremap" mapping.
- if (typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL
+ if (typebuf.tb_len >= 3
+ && typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL
&& typebuf.tb_buf[typebuf.tb_off + 1] == KS_EXTRA
&& typebuf.tb_buf[typebuf.tb_off + 2] == KE_PLUG)
is_plug_map = TRUE;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ren-deqi/vim.git
git@gitee.com:ren-deqi/vim.git
ren-deqi
vim
vim
master

搜索帮助