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>
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);
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 603,
/**/
602,
/**/