vim/backport-CVE-2022-0359.patch
shixuantong 0842389d6c fix CVE-2022-0351 CVE-2022-0361 CVE-2022-0408 CVE-2022-0359 CVE-2022-0368 CVE-2022-0413
(cherry picked from commit 13e64223e934a5ac08bf434b998cf45530cc6822)
2022-02-08 11:25:49 +08:00

29 lines
860 B
Diff

From 85b6747abc15a7a81086db31289cf1b8b17e6cb1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <Bram@vim.org>
Date: Tue, 25 Jan 2022 11:55:02 +0000
Subject: [PATCH] patch 8.2.4214: illegal memory access with large 'tabstop' in
Ex mode
Problem: Illegal memory access with large 'tabstop' in Ex mode.
Solution: Allocate enough memory.
---
src/ex_getln.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 769dcb8..68b4757 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -856,7 +856,7 @@ getcmdline_int(
ccline.cmdindent = (firstc > 0 ? indent : 0);
// alloc initial ccline.cmdbuff
- alloc_cmdbuff(exmode_active ? 250 : indent + 1);
+ alloc_cmdbuff(indent + 50);
if (ccline.cmdbuff == NULL)
goto theend; // out of memory
ccline.cmdlen = ccline.cmdpos = 0;
--
1.8.3.1