To: vim_dev@googlegroups.com Subject: Patch 8.1.2116 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2116 Problem: No check for out of memory. Solution: Check for NULL pointer. Files: src/option.c *** ../vim-8.1.2115/src/option.c 2019-10-05 12:09:21.258785431 +0200 --- src/option.c 2019-10-05 21:30:16.442560689 +0200 *************** *** 112,120 **** { len = STRLEN(p) + 3; // two quotes and a trailing NUL cmd = alloc(len); ! vim_snprintf((char *)cmd, len, "\"%s\"", p); ! set_string_default("sh", cmd); ! vim_free(cmd); } else set_string_default("sh", p); --- 112,123 ---- { len = STRLEN(p) + 3; // two quotes and a trailing NUL cmd = alloc(len); ! if (cmd != NULL) ! { ! vim_snprintf((char *)cmd, len, "\"%s\"", p); ! set_string_default("sh", cmd); ! vim_free(cmd); ! } } else set_string_default("sh", p); *** ../vim-8.1.2115/src/version.c 2019-10-05 12:09:21.262785409 +0200 --- src/version.c 2019-10-05 21:31:29.410162810 +0200 *************** *** 755,756 **** --- 755,758 ---- { /* Add new patch number below this line */ + /**/ + 2116, /**/ -- Q: How do you tell the difference between a female cat and a male cat? A: You ask it a question and if HE answers, it's a male but, if SHE answers, it's a female. /// 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 ///