Skip to content

Commit cfd3b2d

Browse files
committed
Merge pull request #578 from av3r4ge/plugin-names-security-enhancement
Prevent insecure plugin names.
2 parents 34a3077 + 2506347 commit cfd3b2d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

autoload/vundle/config.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ funct! s:check_bundle_name(bundle)
9797
\ ' previously used the name "' . a:bundle.name . '"' .
9898
\ '. Skipping Plugin ' . a:bundle.name_spec . '.'
9999
return 0
100+
elseif a:bundle.name !~ '\v^[A-Za-z0-9_-]%(\.?[A-Za-z0-9_-])*$'
101+
echoerr 'Invalid plugin name: ' . a:bundle.name
102+
return 0
100103
endif
101104
let s:bundle_names[a:bundle.name] = a:bundle.name_spec
102105
return 1
@@ -262,7 +265,7 @@ let s:bundle = {}
262265
" return -- the target location to clone this bundle to
263266
" ---------------------------------------------------------------------------
264267
func! s:bundle.path()
265-
return s:expand_path(g:vundle#bundle_dir.'/'.self.name)
268+
return s:expand_path(g:vundle#bundle_dir.'/') . self.name
266269
endf
267270

268271

0 commit comments

Comments
 (0)