mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 15:38:33 +00:00
vim-patch:7.4.1641
Problem: Using unterminated string.
Solution: Add NUL before calling vim_strsave_shellescape(). (James McCoy)
5ca84ce4aa
This commit is contained in:
@@ -21993,6 +21993,8 @@ repeat:
|
||||
}
|
||||
|
||||
if (src[*usedlen] == ':' && src[*usedlen + 1] == 'S') {
|
||||
// vim_strsave_shellescape() needs a NUL terminated string.
|
||||
(*fnamep)[*fnamelen] = NUL;
|
||||
p = vim_strsave_shellescape(*fnamep, false, false);
|
||||
xfree(*bufp);
|
||||
*bufp = *fnamep = p;
|
||||
|
@@ -69,6 +69,7 @@ static char *features[] = {
|
||||
|
||||
// clang-format off
|
||||
static int included_patches[] = {
|
||||
1641,
|
||||
1574,
|
||||
1570,
|
||||
1511,
|
||||
|
@@ -43,6 +43,7 @@ describe('filename modifiers', function()
|
||||
execute([=[Put fnamemodify('abc'' ''def', ':S' )]=])
|
||||
execute([=[Put fnamemodify('abc''%''def', ':S' )]=])
|
||||
execute([=[Put fnamemodify("abc\ndef", ':S' )]=])
|
||||
execute([=[Put expand('%:r:S') == shellescape(expand('%:r'))]=])
|
||||
execute([=[set shell=tcsh]=])
|
||||
execute([=[Put fnamemodify("abc\ndef", ':S' )]=])
|
||||
execute([=[1 delete _]=])
|
||||
@@ -76,6 +77,7 @@ describe('filename modifiers', function()
|
||||
fnamemodify('abc'' ''def', ':S' ) '''abc''\'''' ''\''''def'''
|
||||
fnamemodify('abc''%''def', ':S' ) '''abc''\''''%''\''''def'''
|
||||
fnamemodify("abc\ndef", ':S' ) '''abc^@def'''
|
||||
expand('%:r:S') == shellescape(expand('%:r')) 1
|
||||
fnamemodify("abc\ndef", ':S' ) '''abc\^@def''']=])
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user