mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.1.2116: no check for out of memory
Problem: No check for out of memory. Solution: Check for NULL pointer.
This commit is contained in:
@@ -112,10 +112,13 @@ set_init_1(int clean_arg)
|
|||||||
{
|
{
|
||||||
len = STRLEN(p) + 3; // two quotes and a trailing NUL
|
len = STRLEN(p) + 3; // two quotes and a trailing NUL
|
||||||
cmd = alloc(len);
|
cmd = alloc(len);
|
||||||
|
if (cmd != NULL)
|
||||||
|
{
|
||||||
vim_snprintf((char *)cmd, len, "\"%s\"", p);
|
vim_snprintf((char *)cmd, len, "\"%s\"", p);
|
||||||
set_string_default("sh", cmd);
|
set_string_default("sh", cmd);
|
||||||
vim_free(cmd);
|
vim_free(cmd);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
set_string_default("sh", p);
|
set_string_default("sh", p);
|
||||||
}
|
}
|
||||||
|
@@ -753,6 +753,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2116,
|
||||||
/**/
|
/**/
|
||||||
2115,
|
2115,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user