• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Révisiona89cf47ba8ed8df648b5ec3c6f9aeb7e39955a86 (tree)
l'heure2022-01-16 23:00:04
AuteurBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Message de Log

patch 8.2.4108: going over the end of the w_lines array

Commit: https://github.com/vim/vim/commit/f6ebc820041b3f77794297026b46c1ebbc279a3a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 16 13:58:33 2022 +0000

patch 8.2.4108: going over the end of the w_lines array
Problem: Going over the end of the w_lines array.
Solution: Check not going over the end and limit to Rows. (issue https://github.com/vim/vim/issues/9540)

Change Summary

Modification

diff -r 18eff22f94bd -r a89cf47ba8ed src/drawscreen.c
--- a/src/drawscreen.c Sun Jan 16 14:45:03 2022 +0100
+++ b/src/drawscreen.c Sun Jan 16 15:00:04 2022 +0100
@@ -1815,10 +1815,11 @@
18151815 // When topline didn't change, find first entry in w_lines[] that
18161816 // needs updating.
18171817
1818- // try to find wp->w_topline in wp->w_lines[].wl_lnum
1818+ // Try to find wp->w_topline in wp->w_lines[].wl_lnum. The check
1819+ // for "Rows" is in case "wl_size" is incorrect somehow.
18191820 j = -1;
18201821 row = 0;
1821- for (i = 0; i < wp->w_lines_valid; i++)
1822+ for (i = 0; i < wp->w_lines_valid && i < Rows; i++)
18221823 {
18231824 if (wp->w_lines[i].wl_valid
18241825 && wp->w_lines[i].wl_lnum == wp->w_topline)
@@ -1848,6 +1849,8 @@
18481849 // ... but don't delete new filler lines.
18491850 row -= wp->w_topfill;
18501851 #endif
1852+ if (row > Rows) // just in case
1853+ row = Rows;
18511854 if (row > 0)
18521855 {
18531856 check_for_delay(FALSE);
diff -r 18eff22f94bd -r a89cf47ba8ed src/version.c
--- a/src/version.c Sun Jan 16 14:45:03 2022 +0100
+++ b/src/version.c Sun Jan 16 15:00:04 2022 +0100
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 4108,
755+/**/
754756 4107,
755757 /**/
756758 4106,
Afficher sur ancien navigateur de dépôt.