Browse Source

Prevent insecure plugin names.

Plugins' names which contain '../', '$HOME', '%:h:h', '..\', etc.
can be dangerous.
Use a sensible whitelist for plugin names and prevent its expansion.
pull/578/head
Shahaf Arad 11 years ago
parent
commit
2506347586
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      autoload/vundle/config.vim

+ 4
- 1
autoload/vundle/config.vim View File

@ -97,6 +97,9 @@ funct! s:check_bundle_name(bundle)
\ ' previously used the name "' . a:bundle.name . '"' .
\ '. Skipping Plugin ' . a:bundle.name_spec . '.'
return 0
elseif a:bundle.name !~ '\v^[A-Za-z0-9_-]%(\.?[A-Za-z0-9_-])*$'
echoerr 'Invalid plugin name: ' . a:bundle.name
return 0
endif
let s:bundle_names[a:bundle.name] = a:bundle.name_spec
return 1
@ -262,7 +265,7 @@ let s:bundle = {}
" return -- the target location to clone this bundle to
" ---------------------------------------------------------------------------
func! s:bundle.path()
return s:expand_path(g:vundle#bundle_dir.'/'.self.name)
return s:expand_path(g:vundle#bundle_dir.'/') . self.name
endf


Loading…
Cancel
Save