summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-04-01 19:44:47 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-01 19:44:47 +0100
commit17fa233f6f88587d35310b76f48c5a26642c470a (patch)
tree7dc95e7c48fbf06d313fdd95c5d65b508b423a79
parent22ebd172e48ba060c8a7bae3dbf6480b7596d937 (diff)
patch 8.2.4663: occasional crash when running the GUI testsv8.2.4663
Problem: Occasional crash when running the GUI tests. Solution: Check that the line index is not too high. (closes #8681)
-rw-r--r--src/screen.c19
-rw-r--r--src/version.c2
2 files changed, 13 insertions, 8 deletions
diff --git a/src/screen.c b/src/screen.c
index db1a763aae..3713f49fd6 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -3634,9 +3634,9 @@ win_rest_invalid(win_T *wp)
/*
* insert lines on the screen and update ScreenLines[]
- * 'end' is the line after the scrolled part. Normally it is Rows.
- * When scrolling region used 'off' is the offset from the top for the region.
- * 'row' and 'end' are relative to the start of the region.
+ * "end" is the line after the scrolled part. Normally it is Rows.
+ * When scrolling region used "off" is the offset from the top for the region.
+ * "row" and "end" are relative to the start of the region.
*
* return FAIL for failure, OK for success.
*/
@@ -3661,14 +3661,15 @@ screen_ins_lines(
/*
* FAIL if
* - there is no valid screen
- * - the screen has to be redrawn completely
* - the line count is less than one
* - the line count is more than 'ttyscroll'
+ * - "end" is more than "Rows" (safety check, should not happen)
* - redrawing for a callback and there is a modeless selection
* - there is a popup window
*/
if (!screen_valid(TRUE)
|| line_count <= 0 || line_count > p_ttyscroll
+ || end > Rows
#ifdef FEAT_CLIPBOARD
|| (clip_star.state != SELECT_CLEARED
&& redrawing_for_callback > 0)
@@ -3896,13 +3897,15 @@ screen_del_lines(
* - the screen has to be redrawn completely
* - the line count is less than one
* - the line count is more than 'ttyscroll'
+ * - "end" is more than "Rows" (safety check, should not happen)
* - redrawing for a callback and there is a modeless selection
*/
- if (!screen_valid(TRUE) || line_count <= 0
- || (!force && line_count > p_ttyscroll)
+ if (!screen_valid(TRUE)
+ || line_count <= 0
+ || (!force && line_count > p_ttyscroll)
+ || end > Rows
#ifdef FEAT_CLIPBOARD
- || (clip_star.state != SELECT_CLEARED
- && redrawing_for_callback > 0)
+ || (clip_star.state != SELECT_CLEARED && redrawing_for_callback > 0)
#endif
)
return FAIL;
diff --git a/src/version.c b/src/version.c
index d3be7a8536..72ba02c487 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4663,
+/**/
4662,
/**/
4661,