Patch 8.1.1894

18 views
Skip to first unread message

Bram Moolenaar

unread,
Aug 20, 2019, 3:58:22 PM8/20/19
to vim...@googlegroups.com

Patch 8.1.1894
Problem: Not checking for out-of-memory of autoload_name().
Solution: Check for NULL. (Dominique Pelle, closes #4846)
Files: src/eval.c


*** ../vim-8.1.1893/src/eval.c 2019-08-20 20:13:40.322821973 +0200
--- src/eval.c 2019-08-20 21:55:42.721530764 +0200
***************
*** 9439,9445 ****
// Get the script file name: replace '#' with '/', append ".vim".
scriptname = alloc(STRLEN(name) + 14);
if (scriptname == NULL)
! return FALSE;
STRCPY(scriptname, "autoload/");
STRCAT(scriptname, name);
for (p = scriptname + 9; (p = vim_strchr(p, AUTOLOAD_CHAR)) != NULL;
--- 9439,9445 ----
// Get the script file name: replace '#' with '/', append ".vim".
scriptname = alloc(STRLEN(name) + 14);
if (scriptname == NULL)
! return NULL;
STRCPY(scriptname, "autoload/");
STRCAT(scriptname, name);
for (p = scriptname + 9; (p = vim_strchr(p, AUTOLOAD_CHAR)) != NULL;
***************
*** 9469,9474 ****
--- 9469,9476 ----
return FALSE;

tofree = scriptname = autoload_name(name);
+ if (scriptname == NULL)
+ return FALSE;

/* Find the name in the list of previously loaded package names. Skip
* "autoload/", it's always the same. */
*** ../vim-8.1.1893/src/version.c 2019-08-20 21:25:42.889316651 +0200
--- src/version.c 2019-08-20 21:56:41.169166468 +0200
***************
*** 767,768 ****
--- 767,770 ----
{ /* Add new patch number below this line */
+ /**/
+ 1894,
/**/

--
From "know your smileys":
:-X My lips are sealed

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages