mirror of
https://github.com/vim/vim.git
synced 2026-06-10 15:37:26 +02:00
patch 9.2.0603: possible heap-buffer-overflow when resizing the GUI
Problem: possible heap-buffer-overflow when resizing the GUI
Solution: Check that the cursor position falls inside the GUI display
area (Foxe Chen).
closes: #20449
Supported by AI
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
1ffc1aaa43
commit
bca1549207
@@ -3378,6 +3378,13 @@ give_up:
|
||||
screen_Rows = Rows;
|
||||
screen_Columns = Columns;
|
||||
|
||||
#ifdef FEAT_GUI
|
||||
// Cursor position may now be out of bounds after resize
|
||||
if (gui.in_use && (gui.cursor_row >= screen_Rows
|
||||
|| gui.cursor_col >= screen_Columns))
|
||||
gui.cursor_is_valid = false;
|
||||
#endif
|
||||
|
||||
set_must_redraw(UPD_CLEAR); // need to clear the screen later
|
||||
if (doclear)
|
||||
screenclear2(TRUE);
|
||||
|
||||
@@ -729,6 +729,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
603,
|
||||
/**/
|
||||
602,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user