Patch 8.2.4108
Problem:    Going over the end of the w_lines array.
Solution:   Check not going over the end and limit to Rows. (issue #9540)
Files:      src/drawscreen.c


*** ../vim-8.2.4107/src/drawscreen.c    2022-01-16 11:42:16.180527699 +0000
--- src/drawscreen.c    2022-01-16 13:56:10.414470766 +0000
***************
*** 1815,1824 ****
            // When topline didn't change, find first entry in w_lines[] that
            // needs updating.
  
!           // try to find wp->w_topline in wp->w_lines[].wl_lnum
            j = -1;
            row = 0;
!           for (i = 0; i < wp->w_lines_valid; i++)
            {
                if (wp->w_lines[i].wl_valid
                        && wp->w_lines[i].wl_lnum == wp->w_topline)
--- 1815,1825 ----
            // When topline didn't change, find first entry in w_lines[] that
            // needs updating.
  
!           // Try to find wp->w_topline in wp->w_lines[].wl_lnum.  The check
!           // for "Rows" is in case "wl_size" is incorrect somehow.
            j = -1;
            row = 0;
!           for (i = 0; i < wp->w_lines_valid && i < Rows; i++)
            {
                if (wp->w_lines[i].wl_valid
                        && wp->w_lines[i].wl_lnum == wp->w_topline)
***************
*** 1848,1853 ****
--- 1849,1856 ----
                // ... but don't delete new filler lines.
                row -= wp->w_topfill;
  #endif
+               if (row > Rows)  // just in case
+                   row = Rows;
                if (row > 0)
                {
                    check_for_delay(FALSE);
*** ../vim-8.2.4107/src/version.c       2022-01-16 13:30:29.877688041 +0000
--- src/version.c       2022-01-16 13:58:22.810216961 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4108,
  /**/

-- 
MORTICIAN:    Bring out your dead!
              [clang]
              Bring out your dead!
              [clang]
              Bring out your dead!
CUSTOMER:     Here's one -- nine pence.
DEAD PERSON:  I'm not dead!
                                  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220116135911.AD4201C0519%40moolenaar.net.

Raspunde prin e-mail lui