mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.4901: NULL pointer access when using invalid pattern
Problem: NULL pointer access when using invalid pattern. Solution: Check for failed regexp program.
This commit is contained in:
@@ -2957,7 +2957,7 @@ fname_match(
|
|||||||
rmp->rm_ic = p_fic || ignore_case;
|
rmp->rm_ic = p_fic || ignore_case;
|
||||||
if (vim_regexec(rmp, name, (colnr_T)0))
|
if (vim_regexec(rmp, name, (colnr_T)0))
|
||||||
match = name;
|
match = name;
|
||||||
else
|
else if (rmp->regprog != NULL)
|
||||||
{
|
{
|
||||||
// Replace $(HOME) with '~' and try matching again.
|
// Replace $(HOME) with '~' and try matching again.
|
||||||
p = home_replace_save(NULL, name);
|
p = home_replace_save(NULL, name);
|
||||||
|
@@ -410,6 +410,13 @@ func Test_buffer_scheme()
|
|||||||
set shellslash&
|
set shellslash&
|
||||||
endfunc
|
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
|
" Test for the 'maxmem' and 'maxmemtot' options
|
||||||
func Test_buffer_maxmem()
|
func Test_buffer_maxmem()
|
||||||
" use 1KB per buffer and 2KB for all the buffers
|
" use 1KB per buffer and 2KB for all the buffers
|
||||||
|
@@ -746,6 +746,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
4901,
|
||||||
/**/
|
/**/
|
||||||
4900,
|
4900,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user