]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/blob - meta/recipes-support/vim/files/0001-patch-8.2.3581-reading-character-past-end-of-line.patch
28c61cd782c28a3c2006f044e98c5e22e16cf661
[thirdparty/openembedded/openembedded-core.git] / meta / recipes-support / vim / files / 0001-patch-8.2.3581-reading-character-past-end-of-line.patch
1 CVE: CVE-2021-3927
2 Upstream-Status: Backport
3 Signed-off-by: Ross Burton <ross.burton@arm.com>
4
5 From 93b427c6e729260d0700c3b2804ec153bc8284fa Mon Sep 17 00:00:00 2001
6 From: Bram Moolenaar <Bram@vim.org>
7 Date: Thu, 4 Nov 2021 15:10:11 +0000
8 Subject: [PATCH] patch 8.2.3581: reading character past end of line
9
10 Problem: Reading character past end of line.
11 Solution: Correct the cursor column.
12 ---
13 src/ex_docmd.c | 1 +
14 src/testdir/test_put.vim | 12 ++++++++++++
15 src/version.c | 2 ++
16 3 files changed, 15 insertions(+)
17
18 diff --git a/src/ex_docmd.c b/src/ex_docmd.c
19 index fde726477..59e245bee 100644
20 --- a/src/ex_docmd.c
21 +++ b/src/ex_docmd.c
22 @@ -6905,6 +6905,7 @@ ex_put(exarg_T *eap)
23 eap->forceit = TRUE;
24 }
25 curwin->w_cursor.lnum = eap->line2;
26 + check_cursor_col();
27 do_put(eap->regname, eap->forceit ? BACKWARD : FORWARD, 1L,
28 PUT_LINE|PUT_CURSLINE);
29 }
30 diff --git a/src/testdir/test_put.vim b/src/testdir/test_put.vim
31 index 225ebd1f3..922e5b269 100644
32 --- a/src/testdir/test_put.vim
33 +++ b/src/testdir/test_put.vim
34 @@ -113,3 +113,15 @@ func Test_put_p_indent_visual()
35 call assert_equal('select that text', getline(2))
36 bwipe!
37 endfunc
38 +
39 +func Test_put_above_first_line()
40 + new
41 + let @" = 'text'
42 + silent! normal 0o00
43 + 0put
44 + call assert_equal('text', getline(1))
45 + bwipe!
46 +endfunc
47 +
48 +
49 +" vim: shiftwidth=2 sts=2 expandtab
50 diff --git a/src/version.c b/src/version.c
51 index a9e8be0e7..df4ec9a47 100644
52 --- a/src/version.c
53 +++ b/src/version.c
54 @@ -742,6 +742,8 @@ static char *(features[]) =
55
56 static int included_patches[] =
57 { /* Add new patch number below this line */
58 +/**/
59 + 3581,
60 /**/
61 3564,
62 /**/