summaryrefslogtreecommitdiffstats
path: root/debian/patches/CVE-2022-1720.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-08 05:05:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-08 05:05:34 +0000
commitcbedd7c5597b906e5de95debeced81743a21a9f1 (patch)
tree23004fa91a33d235aa7c06049d3420a238f24eb7 /debian/patches/CVE-2022-1720.patch
parentReleasing debian version 2:8.1.0875-5+deb10u2progress5u1. (diff)
downloadvim-cbedd7c5597b906e5de95debeced81743a21a9f1.tar.xz
vim-cbedd7c5597b906e5de95debeced81743a21a9f1.zip
Merging debian version 2:8.1.0875-5+deb10u3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/CVE-2022-1720.patch')
-rw-r--r--debian/patches/CVE-2022-1720.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/debian/patches/CVE-2022-1720.patch b/debian/patches/CVE-2022-1720.patch
new file mode 100644
index 0000000..80855fb
--- /dev/null
+++ b/debian/patches/CVE-2022-1720.patch
@@ -0,0 +1,34 @@
+From: Markus Koschany <apo@debian.org>
+Date: Mon, 31 Oct 2022 20:40:05 +0100
+Subject: CVE-2022-1720
+
+Origin: https://github.com/vim/vim/commit/395bd1f6d3edc9f7edb5d1f2d7deaf5a9e3ab93c
+---
+ src/normal.c | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/src/normal.c b/src/normal.c
+index 2c36c15..ebda136 100644
+--- a/src/normal.c
++++ b/src/normal.c
+@@ -5777,9 +5777,17 @@ get_visual_text(
+ *pp = ml_get_pos(&VIsual);
+ *lenp = curwin->w_cursor.col - VIsual.col + 1;
+ }
+- if (has_mbyte)
+- /* Correct the length to include the whole last character. */
+- *lenp += (*mb_ptr2len)(*pp + (*lenp - 1)) - 1;
++ if (*lenp > 0)
++ {
++ if (has_mbyte)
++ // Correct the length to include all bytes of the last
++ // character.
++ *lenp += (*mb_ptr2len)(*pp + (*lenp - 1)) - 1;
++ else if ((*pp)[*lenp - 1] == NUL)
++ // Do not include a trailing NUL.
++ *lenp -= 1;
++ }
++
+ }
+ reset_VIsual_and_resel();
+ return OK;