mirror of
https://github.com/vim/vim.git
synced 2025-07-24 10:45:12 -04:00
patch 8.1.2105: MS-Windows: system() may crash
Problem: MS-Windows: system() may crash. Solution: Do not use "itmp" when it is NULL. (Yasuhiro Matsumoto, closes #5005)
This commit is contained in:
parent
792cf5e1be
commit
2886dcceba
@ -1778,28 +1778,30 @@ make_filter_cmd(
|
||||
}
|
||||
else
|
||||
{
|
||||
char_u *p;
|
||||
STRCPY(buf, cmd);
|
||||
if (itmp != NULL)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
/*
|
||||
* If there is a pipe, we have to put the '<' in front of it.
|
||||
* Don't do this when 'shellquote' is not empty, otherwise the
|
||||
* redirection would be inside the quotes.
|
||||
*/
|
||||
if (*p_shq == NUL)
|
||||
{
|
||||
p = find_pipe(buf);
|
||||
if (p != NULL)
|
||||
*p = NUL;
|
||||
}
|
||||
STRCAT(buf, " <"); /* " < " causes problems on Amiga */
|
||||
STRCAT(buf, itmp);
|
||||
if (*p_shq == NUL)
|
||||
{
|
||||
p = find_pipe(cmd);
|
||||
if (p != NULL)
|
||||
// If there is a pipe, we have to put the '<' in front of it.
|
||||
// Don't do this when 'shellquote' is not empty, otherwise the
|
||||
// redirection would be inside the quotes.
|
||||
if (*p_shq == NUL)
|
||||
{
|
||||
STRCAT(buf, " "); /* insert a space before the '|' for DOS */
|
||||
STRCAT(buf, p);
|
||||
p = find_pipe(buf);
|
||||
if (p != NULL)
|
||||
*p = NUL;
|
||||
}
|
||||
STRCAT(buf, " <"); // " < " causes problems on Amiga
|
||||
STRCAT(buf, itmp);
|
||||
if (*p_shq == NUL)
|
||||
{
|
||||
p = find_pipe(cmd);
|
||||
if (p != NULL)
|
||||
{
|
||||
STRCAT(buf, " "); // insert a space before the '|' for DOS
|
||||
STRCAT(buf, p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -753,6 +753,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2105,
|
||||
/**/
|
||||
2104,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user