blob: bb1c91b1326e190db02f68ee20452b33dc822c35 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
From: Markus Koschany <apo@debian.org>
Date: Sun, 23 Oct 2022 16:01:20 +0200
Subject: CVE-2022-0213
Origin: https://github.com/vim/vim/commit/de05bb25733c3319e18dca44e9b59c6ee389eb26
---
src/screen.c | 3 ++-
src/testdir/test_edit.vim | 14 ++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
--- a/src/screen.c
+++ b/src/screen.c
@@ -6878,12 +6878,13 @@ win_redr_status(win_T *wp, int ignore_pu
p = NameBuff;
len = (int)STRLEN(p);
- if (bt_help(wp->w_buffer)
+ if ((bt_help(wp->w_buffer)
#ifdef FEAT_QUICKFIX
|| wp->w_p_pvw
#endif
|| bufIsChanged(wp->w_buffer)
|| wp->w_buffer->b_p_ro)
+ && len < MAXPATHL - 1)
*(p + len++) = ' ';
if (bt_help(wp->w_buffer))
{
--- a/src/testdir/test_edit.vim
+++ b/src/testdir/test_edit.vim
@@ -1449,4 +1449,18 @@ func Test_edit_put_CTRL_E()
set encoding=utf-8
endfunc
+" CVE-2022-0213
+func Test_edit_overlong_file_name()
+
+ file 0000000000000000000000000000
+ file %%%%%%%%%%%%%%%%%%%%%%%%%%
+ file %%%%%%
+ set readonly
+ set ls=2
+
+ redraw!
+ set noreadonly ls&
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
|