Mirror of the Vim source from https://github.com/vim/vim
Révision | a89cf47ba8ed8df648b5ec3c6f9aeb7e39955a86 (tree) |
---|---|
l'heure | 2022-01-16 23:00:04 |
Auteur | Bram Moolenaar <Bram@vim....> |
Commiter | Bram Moolenaar |
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
@@ -1815,10 +1815,11 @@ | ||
1815 | 1815 | // When topline didn't change, find first entry in w_lines[] that |
1816 | 1816 | // needs updating. |
1817 | 1817 | |
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. | |
1819 | 1820 | j = -1; |
1820 | 1821 | row = 0; |
1821 | - for (i = 0; i < wp->w_lines_valid; i++) | |
1822 | + for (i = 0; i < wp->w_lines_valid && i < Rows; i++) | |
1822 | 1823 | { |
1823 | 1824 | if (wp->w_lines[i].wl_valid |
1824 | 1825 | && wp->w_lines[i].wl_lnum == wp->w_topline) |
@@ -1848,6 +1849,8 @@ | ||
1848 | 1849 | // ... but don't delete new filler lines. |
1849 | 1850 | row -= wp->w_topfill; |
1850 | 1851 | #endif |
1852 | + if (row > Rows) // just in case | |
1853 | + row = Rows; | |
1851 | 1854 | if (row > 0) |
1852 | 1855 | { |
1853 | 1856 | check_for_delay(FALSE); |
@@ -751,6 +751,8 @@ | ||
751 | 751 | static int included_patches[] = |
752 | 752 | { /* Add new patch number below this line */ |
753 | 753 | /**/ |
754 | + 4108, | |
755 | +/**/ | |
754 | 756 | 4107, |
755 | 757 | /**/ |
756 | 758 | 4106, |