aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2026-10-13 08:36:32 +0800
committerzeertzjq <zeertzjq@outlook.com>2026-10-13 08:45:57 +0800
commit3597f5cae7f513ceb9fdcbdbef8c6706bfb76e36 (patch)
treeafbcd3d8eb1dd65f83f5c657c4010a53fa2de310 /runtime
parente7cd0e4375a48d32eea6776d6d26e92eed9fedbe (diff)
downloadrneovim-3597f5cae7f513ceb9fdcbdbef8c6706bfb76e36.tar.gz
rneovim-3597f5cae7f513ceb9fdcbdbef8c6706bfb76e36.tar.bz2
rneovim-3597f5cae7f513ceb9fdcbdbef8c6706bfb76e36.zip
vim-patch:40295c9: runtime(go): prevent code injection with keywordprg
https://github.com/vim/vim/commit/40295c92be643a09d6443121637fa93d6cd105a1 Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime')
-rw-r--r--runtime/ftplugin/go.vim7
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/ftplugin/go.vim b/runtime/ftplugin/go.vim
index 606e75771e..9771d27333 100644
--- a/runtime/ftplugin/go.vim
+++ b/runtime/ftplugin/go.vim
@@ -10,6 +10,7 @@
" 2025 Jul 05 by Vim Project (update b:undo_ftplugin #17664)
" 2026 Feb 13 by Vim Project (remove formatprg #19108)
" 2026 Jun 27 by Vim Project (normalize recommended style guard)
+" 2026 Oct 12 by Vim Project (correctly use shellescape())
if exists('b:did_ftplugin')
finish
@@ -41,8 +42,10 @@ if !exists('*' . expand('<SID>') . 'GoKeywordPrg')
let temp_isk = &l:iskeyword
setl iskeyword+=.
try
- let cmd = 'go doc -C ' . shellescape(expand('%:h')) . ' ' . shellescape(expand('<cword>'))
- if has('gui_running') || has('nvim')
+ let cmd = 'go doc -C ' . shellescape(expand('%:h'), 1) . ' ' . shellescape(expand('<cword>'), 1)
+ if has('gui_running')
+ exe 'hor term ++shell' cmd
+ elseif has('nvim')
exe 'hor term' cmd
else
exe '!' . cmd