mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.1.1894: not checking for out-of-memory of autoload_name()
Problem: Not checking for out-of-memory of autoload_name(). Solution: Check for NULL. (Dominique Pelle, closes #4846)
This commit is contained in:
@@ -9439,7 +9439,7 @@ autoload_name(char_u *name)
|
|||||||
// Get the script file name: replace '#' with '/', append ".vim".
|
// Get the script file name: replace '#' with '/', append ".vim".
|
||||||
scriptname = alloc(STRLEN(name) + 14);
|
scriptname = alloc(STRLEN(name) + 14);
|
||||||
if (scriptname == NULL)
|
if (scriptname == NULL)
|
||||||
return FALSE;
|
return NULL;
|
||||||
STRCPY(scriptname, "autoload/");
|
STRCPY(scriptname, "autoload/");
|
||||||
STRCAT(scriptname, name);
|
STRCAT(scriptname, name);
|
||||||
for (p = scriptname + 9; (p = vim_strchr(p, AUTOLOAD_CHAR)) != NULL;
|
for (p = scriptname + 9; (p = vim_strchr(p, AUTOLOAD_CHAR)) != NULL;
|
||||||
@@ -9469,6 +9469,8 @@ script_autoload(
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
tofree = scriptname = autoload_name(name);
|
tofree = scriptname = autoload_name(name);
|
||||||
|
if (scriptname == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* Find the name in the list of previously loaded package names. Skip
|
/* Find the name in the list of previously loaded package names. Skip
|
||||||
* "autoload/", it's always the same. */
|
* "autoload/", it's always the same. */
|
||||||
|
@@ -765,6 +765,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 */
|
||||||
|
/**/
|
||||||
|
1894,
|
||||||
/**/
|
/**/
|
||||||
1893,
|
1893,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user