To: vim_dev@googlegroups.com Subject: Patch 7.4.1665 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1665 Problem: Crash when calling job_start() with a NULL string. (Dominique) Solution: Check for an invalid argument. Files: src/channel.c, src/testdir/test_channel.vim *** ../vim-7.4.1664/src/channel.c 2016-03-26 22:56:41.879646383 +0100 --- src/channel.c 2016-03-27 19:12:05.882855009 +0200 *************** *** 3812,3817 **** --- 3812,3822 ---- { /* Command is a string. */ cmd = argvars[0].vval.v_string; + if (cmd == NULL || *cmd == NUL) + { + EMSG(_(e_invarg)); + return job; + } #ifdef USE_ARGV if (mch_parse_cmd(cmd, FALSE, &argv, &argc) == FAIL) return job; *** ../vim-7.4.1664/src/testdir/test_channel.vim 2016-03-27 15:13:06.958231628 +0200 --- src/testdir/test_channel.vim 2016-03-27 19:12:13.910773291 +0200 *************** *** 1201,1205 **** --- 1201,1210 ---- call s:run_server('s:test_close_callback') endfunc + func Test_job_start_invalid() + call assert_fails('call job_start($x)', 'E474:') + call assert_fails('call job_start("")', 'E474:') + endfunc + " Uncomment this to see what happens, output is in src/testdir/channellog. " call ch_logfile('channellog', 'w') *** ../vim-7.4.1664/src/version.c 2016-03-27 18:44:36.827626918 +0200 --- src/version.c 2016-03-27 19:10:44.663681728 +0200 *************** *** 750,751 **** --- 750,753 ---- { /* Add new patch number below this line */ + /**/ + 1665, /**/ -- hundred-and-one symptoms of being an internet addict: 141. You'd rather go to http://www.weather.com/ than look out your window. /// 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 ///