To: vim_dev@googlegroups.com Subject: Patch 8.2.4108 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///