mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.0189: cd() with NULL argument crashes
Problem: cd() with NULL argument crashes. Solution: Check for NULL. (Ken Takata, closes #5558)
This commit is contained in:
parent
7f829cab35
commit
7cc96923c4
@ -6572,7 +6572,7 @@ changedir_func(
|
||||
int dir_differs;
|
||||
int retval = FALSE;
|
||||
|
||||
if (allbuf_locked())
|
||||
if (new_dir == NULL || allbuf_locked())
|
||||
return FALSE;
|
||||
|
||||
if (vim_strchr(p_cpo, CPO_CHDIR) != NULL && curbufIsChanged() && !forceit)
|
||||
|
@ -101,6 +101,8 @@ func Test_chdir_func()
|
||||
call assert_fails("call chdir('dir-abcd')", 'E472:')
|
||||
silent! let d = chdir("dir_abcd")
|
||||
call assert_equal("", d)
|
||||
" Should not crash
|
||||
call chdir(d)
|
||||
|
||||
only | tabonly
|
||||
call chdir(topdir)
|
||||
|
@ -742,6 +742,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
189,
|
||||
/**/
|
||||
188,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user