0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

updated for version 7.4.010

Problem:    Crash with invalid argument to mkdir().
Solution:   Check for empty string. (lcd47)
This commit is contained in:
Bram Moolenaar
2013-08-30 16:00:08 +02:00
parent cf81aefd9c
commit 195ef0ccb2
2 changed files with 17 additions and 10 deletions

View File

@@ -14292,6 +14292,10 @@ f_mkdir(argvars, rettv)
return;
dir = get_tv_string_buf(&argvars[0], buf);
if (*dir == NUL)
rettv->vval.v_number = FAIL;
else
{
if (*gettail(dir) == NUL)
/* remove trailing slashes */
*gettail_sep(dir) = NUL;
@@ -14304,6 +14308,7 @@ f_mkdir(argvars, rettv)
mkdir_recurse(dir, prot);
}
rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot);
}
}
#endif

View File

@@ -727,6 +727,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
10,
/**/
9,
/**/