summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/vim/files/0004-patch-8.2.3489-ml_get-error-after-search-with-range.patch
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-12-06 14:49:53 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-23 23:43:43 +0000
commitdffd5c120b81886ea05242d16d99bc04f236f310 (patch)
tree8093d9e386e19c0ab9491a7407ac44fa03d5b2db /meta/recipes-support/vim/files/0004-patch-8.2.3489-ml_get-error-after-search-with-range.patch
parent7c237d3b2d45bebca8774d3b573d1877153af319 (diff)
downloadpoky-dffd5c120b81886ea05242d16d99bc04f236f310.tar.gz
vim: upgrade to 8.2 patch 3752
There's a fairly constant flow of CVEs being fixed in Vim, which are getting increasing non-trivial to backport. Instead of trying to backport (and potentially introduce more bugs), or just ignoring them entirely, upgrade vim to the latest patch in the hope that vim 8.3 will be released before we release Kirkstone. (From OE-Core rev: 7b8b096000759357aa251a58a756e770a54590ad) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 78a4796de27d710f97c336d288d797557a58694e) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/vim/files/0004-patch-8.2.3489-ml_get-error-after-search-with-range.patch')
-rw-r--r--meta/recipes-support/vim/files/0004-patch-8.2.3489-ml_get-error-after-search-with-range.patch72
1 files changed, 0 insertions, 72 deletions
diff --git a/meta/recipes-support/vim/files/0004-patch-8.2.3489-ml_get-error-after-search-with-range.patch b/meta/recipes-support/vim/files/0004-patch-8.2.3489-ml_get-error-after-search-with-range.patch
deleted file mode 100644
index 045081579c..0000000000
--- a/meta/recipes-support/vim/files/0004-patch-8.2.3489-ml_get-error-after-search-with-range.patch
+++ /dev/null
@@ -1,72 +0,0 @@
1CVE: CVE-2021-3875
2Upstream-Status: Backport
3Signed-off-by: Ross Burton <ross.burton@arm.com>
4
5From b8968e26d7508e7d64bfc86808142818b0a9288c Mon Sep 17 00:00:00 2001
6From: Bram Moolenaar <Bram@vim.org>
7Date: Sat, 9 Oct 2021 13:58:55 +0100
8Subject: [PATCH] patch 8.2.3489: ml_get error after search with range
9
10Problem: ml_get error after search with range.
11Solution: Limit the line number to the buffer line count.
12---
13 src/ex_docmd.c | 6 ++++--
14 src/testdir/test_search.vim | 17 +++++++++++++++++
15 src/version.c | 2 ++
16 3 files changed, 23 insertions(+), 2 deletions(-)
17
18diff --git a/src/ex_docmd.c b/src/ex_docmd.c
19index fb07450f8..fde726477 100644
20--- a/src/ex_docmd.c
21+++ b/src/ex_docmd.c
22@@ -3586,8 +3586,10 @@ get_address(
23
24 // When '/' or '?' follows another address, start from
25 // there.
26- if (lnum != MAXLNUM)
27- curwin->w_cursor.lnum = lnum;
28+ if (lnum > 0 && lnum != MAXLNUM)
29+ curwin->w_cursor.lnum =
30+ lnum > curbuf->b_ml.ml_line_count
31+ ? curbuf->b_ml.ml_line_count : lnum;
32
33 // Start a forward search at the end of the line (unless
34 // before the first line).
35diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
36index 187671305..e142c3547 100644
37--- a/src/testdir/test_search.vim
38+++ b/src/testdir/test_search.vim
39@@ -1366,3 +1366,20 @@ func Test_searchdecl()
40
41 bwipe!
42 endfunc
43+
44+func Test_search_with_invalid_range()
45+ new
46+ let lines =<< trim END
47+ /\%.v
48+ 5/
49+ c
50+ END
51+ call writefile(lines, 'Xrangesearch')
52+ source Xrangesearch
53+
54+ bwipe!
55+ call delete('Xrangesearch')
56+endfunc
57+
58+
59+" vim: shiftwidth=2 sts=2 expandtab
60diff --git a/src/version.c b/src/version.c
61index 2b5de5ccf..092864bbb 100644
62--- a/src/version.c
63+++ b/src/version.c
64@@ -742,6 +742,8 @@ static char *(features[]) =
65
66 static int included_patches[] =
67 { /* Add new patch number below this line */
68+/**/
69+ 3489,
70 /**/
71 3487,
72 /**/