vim-patch:9.2.0458: Crash with invalid shellredir/shellpipe value (#39691)

Problem:  Crash with invalid shellredir/shellpipe value
          (bfredl)
Solution: Validate the option and allow only a single "%s".

fixes:  vim/vim#20157
closes: vim/vim#20159

84ae09dd79

Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2026-05-09 09:13:19 +08:00
committed by GitHub
parent 91b9516d1b
commit ffe87d91f7
7 changed files with 48 additions and 0 deletions

View File

@@ -5918,6 +5918,7 @@ vim.go.shcf = vim.go.shellcmdflag
--- Note: When using a pipe like "| tee", you'll lose the exit code of the
--- shell command. This might be configurable by your shell, look for
--- the pipefail option (for bash and zsh, use ":set -o pipefail").
--- Only a single "%s" value is allowed.
---
--- @type string
vim.o.shellpipe = "| tee"
@@ -5960,6 +5961,8 @@ vim.go.shq = vim.go.shellquote
--- explicitly set before.
--- In the future pipes may be used for filtering and this option will
--- become obsolete (at least for Unix).
--- *E1577*
--- Only a single "%s" item is allowed in the option value.
---
--- @type string
vim.o.shellredir = ">"