Patch 8.2.0089
Problem: Crash when running out of memory in :setfiletype completion.
Solution: Do not allocate memory. (Dominique Pelle, closes #5438)
Files: src/cmdexpand.c
*** ../vim-8.2.0088/src/cmdexpand.c 2020-01-05 14:38:37.110600924 +0100
--- src/cmdexpand.c 2020-01-05 22:04:19.952724414 +0100
***************
*** 2633,2648 ****
ExpandEscape(&xpc, buf, num_p, p, WILD_SILENT|expand_options);
if (ga_grow(ga, num_p) == OK)
! {
for (i = 0; i < num_p; ++i)
{
! ((char_u **)ga->ga_data)[ga->ga_len] =
! vim_strnsave(p[i], (int)STRLEN(p[i]));
++ga->ga_len;
}
! }
!
! FreeWild(num_p, p);
}
}
}
--- 2633,2645 ----
ExpandEscape(&xpc, buf, num_p, p, WILD_SILENT|expand_options);
if (ga_grow(ga, num_p) == OK)
! // take over the pointers and put them in "ga"
for (i = 0; i < num_p; ++i)
{
! ((char_u **)ga->ga_data)[ga->ga_len] = p[i];
++ga->ga_len;
}
! vim_free(p);
}
}
}
*** ../vim-8.2.0088/src/version.c 2020-01-05 20:35:39.967830421 +0100
--- src/version.c 2020-01-05 22:05:34.976425656 +0100
***************
*** 744,745 ****
--- 744,747 ----
{ /* Add new patch number below this line */
+ /**/
+ 89,
/**/
--
Permission is granted to read this message out aloud on Kings Cross Road,
London, under the condition that the orator is properly dressed.
/// Bram Moolenaar -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202001052107.005L7Iht007470%40masaka.moolenaar.net.