To: vim_dev@googlegroups.com Subject: Patch 8.1.1845 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1845 Problem: May use NULL pointer when running out of memory. Solution: Do not clear popup buffers when NULL. (closes #4802) Files: src/screen.c *** ../vim-8.1.1844/src/screen.c 2019-08-04 18:13:43.715225398 +0200 --- src/screen.c 2019-08-13 23:02:46.804223713 +0200 *************** *** 8645,8654 **** --- 8645,8660 ---- } /* Use the last line of the screen for the current line. */ current_ScreenLine = new_ScreenLines + Rows * Columns; + + #ifdef FEAT_TEXT_PROP + vim_memset(new_popup_mask, 0, Rows * Columns * sizeof(short)); + vim_memset(new_popup_transparent, 0, Rows * Columns * sizeof(char)); + #endif } free_screenlines(); + // NOTE: this may result in all pointers to become NULL. ScreenLines = new_ScreenLines; ScreenLinesUC = new_ScreenLinesUC; for (i = 0; i < p_mco; ++i) *************** *** 8661,8670 **** TabPageIdxs = new_TabPageIdxs; #ifdef FEAT_TEXT_PROP popup_mask = new_popup_mask; - vim_memset(popup_mask, 0, Rows * Columns * sizeof(short)); popup_mask_next = new_popup_mask_next; popup_transparent = new_popup_transparent; - vim_memset(popup_transparent, 0, Rows * Columns * sizeof(char)); popup_mask_refresh = TRUE; #endif --- 8667,8674 ---- *** ../vim-8.1.1844/src/version.c 2019-08-13 22:27:27.750277607 +0200 --- src/version.c 2019-08-13 23:03:40.231992635 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 1845, /**/ -- hundred-and-one symptoms of being an internet addict: 53. To find out what time it is, you send yourself an e-mail and check the "Date:" field. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///