To: vim_dev@googlegroups.com Subject: Patch 8.2.4901 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4901 Problem: NULL pointer access when using invalid pattern. Solution: Check for failed regexp program. Files: src/buffer.c, src/testdir/test_buffer.vim *** ../vim-8.2.4900/src/buffer.c 2022-04-19 16:24:08.603559710 +0100 --- src/buffer.c 2022-05-07 11:26:21.781779201 +0100 *************** *** 2957,2963 **** rmp->rm_ic = p_fic || ignore_case; if (vim_regexec(rmp, name, (colnr_T)0)) match = name; ! else { // Replace $(HOME) with '~' and try matching again. p = home_replace_save(NULL, name); --- 2957,2963 ---- rmp->rm_ic = p_fic || ignore_case; if (vim_regexec(rmp, name, (colnr_T)0)) match = name; ! else if (rmp->regprog != NULL) { // Replace $(HOME) with '~' and try matching again. p = home_replace_save(NULL, name); *** ../vim-8.2.4900/src/testdir/test_buffer.vim 2022-04-03 11:22:33.528172299 +0100 --- src/testdir/test_buffer.vim 2022-05-07 11:24:45.077556619 +0100 *************** *** 410,415 **** --- 410,422 ---- set shellslash& endfunc + " this was using a NULL pointer after failing to use the pattern + func Test_buf_pattern_invalid() + vsplit 0000000 + silent! buf [0--]\&\zs*\zs*e + bwipe! + endfunc + " Test for the 'maxmem' and 'maxmemtot' options func Test_buffer_maxmem() " use 1KB per buffer and 2KB for all the buffers *** ../vim-8.2.4900/src/version.c 2022-05-07 10:59:59.567615292 +0100 --- src/version.c 2022-05-07 11:26:56.541850516 +0100 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4901, /**/ -- I have a watch cat! Just break in and she'll watch. /// 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 ///