vim-patch:8.0.0100 (#7085)

vim-patch:8.0.0100

Problem:    Options that are a file name may contain non-filename characters.
Solution:   Check for more invalid characters.

319afe3804
This commit is contained in:
KunMing Xie 2017-07-29 06:00:53 +08:00 committed by Justin M. Keyes
parent 3b45f676c0
commit 707bb37494
2 changed files with 6 additions and 7 deletions

View File

@ -2457,12 +2457,11 @@ did_set_string_option (
if ((secure || sandbox != 0)
&& (options[opt_idx].flags & P_SECURE)) {
errmsg = e_secure;
}
/* Check for a "normal" file name in some options. Disallow a path
* separator (slash and/or backslash), wildcards and characters that are
* often illegal in a file name. */
else if ((options[opt_idx].flags & P_NFNAME)
&& vim_strpbrk(*varp, (char_u *)"/\\*?[|<>") != NULL) {
} else if ((options[opt_idx].flags & P_NFNAME)
&& vim_strpbrk(*varp, (char_u *)"/\\*?[|;&<>\r\n") != NULL) {
// Check for a "normal" file name in some options. Disallow a path
// separator (slash and/or backslash), wildcards and characters that are
// often illegal in a file name.
errmsg = e_invarg;
}
/* 'backupcopy' */

View File

@ -629,7 +629,7 @@ static const int included_patches[] = {
// 103 NA
// 102,
// 101,
// 100,
100,
99,
// 98 NA
// 97 NA