To: vim_dev@googlegroups.com Subject: Patch 8.2.0089 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@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 ///