blob: 592f42566d6b18553006bb6845ff8b59625fb563 (
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
|
From: Markus Koschany <apo@debian.org>
Date: Wed, 19 Oct 2022 19:13:54 +0200
Subject: CVE-2021-3927
Origin: https://github.com/vim/vim/commit/0b5b06cb4777d1401fdf83e7d48d287662236e7e
---
src/ex_docmd.c | 1 +
src/testdir/test_put.vim | 10 ++++++++++
2 files changed, 11 insertions(+)
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -9487,6 +9487,7 @@ ex_put(exarg_T *eap)
eap->forceit = TRUE;
}
curwin->w_cursor.lnum = eap->line2;
+ check_cursor_col();
do_put(eap->regname, eap->forceit ? BACKWARD : FORWARD, 1L,
PUT_LINE|PUT_CURSLINE);
}
--- a/src/testdir/test_put.vim
+++ b/src/testdir/test_put.vim
@@ -101,3 +101,13 @@ func Test_put_p_errmsg_nodup()
delfunction Capture_p_error
bwipeout!
endfunc
+
+func Test_put_above_first_line()
+ new
+ let @" = 'text'
+ silent! normal 0o00
+ 0put
+ call assert_equal('text', getline(1))
+ bwipe!
+endfunc
+
|