vim/backport-CVE-2023-5441.patch
wangjiang 884812a89b fix CVE-2023-5441 CVE-2023-5535
(cherry picked from commit 121098043530f01a169a32875bbbced7a2e8c9a9)
2023-10-17 09:22:07 +08:00

36 lines
1.1 KiB
Diff

From 20d161ace307e28690229b68584f2d84556f8960 Mon Sep 17 00:00:00 2001
From: Christian Brabandt <cb@256bit.org>
Date: Thu, 5 Oct 2023 22:08:30 +0200
Subject: [PATCH] patch 9.0.1992: [security] segfault in exmode
Problem: segfault in exmode when redrawing
Solution: skip gui_scroll when exmode_active
Signed-off-by: Christian Brabandt <cb@256bit.org>
---
src/gui.c | 4 ++++
1 files changed, 4 insertions(+)
diff --git a/src/gui.c b/src/gui.c
index 1f546b2a75b57..9c9aa3cbecdcf 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -4436,6 +4436,7 @@ gui_do_scrollbar(
* Scroll a window according to the values set in the globals current_scrollbar
* and scrollbar_value. Return TRUE if the cursor in the current window moved
* or FALSE otherwise.
+ * may eventually cause a redraw using updateWindow
*/
int
gui_do_scroll(void)
@@ -4455,6 +4456,9 @@ gui_do_scroll(void)
if (wp == NULL)
// Couldn't find window
return FALSE;
+ // don't redraw, LineOffset and similar are not valid!
+ if (exmode_active)
+ return FALSE;
/*
* Compute number of lines to scroll. If zero, nothing to do.