To: vim_dev@googlegroups.com Subject: Patch 7.4.1664 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1664 Problem: Crash in :cgetexpr. Solution: Check for NULL pointer. (Dominique) Add a test. Files: src/quikfix.c, src/testdir/test_quickfix.vim *** ../vim-7.4.1663/src/quickfix.c 2016-03-25 15:01:06.984578229 +0100 --- src/quickfix.c 2016-03-27 18:40:45.777974366 +0200 *************** *** 532,538 **** else if (tv->v_type == VAR_LIST) { /* Get the next line from the supplied list */ ! while (p_li && p_li->li_tv.v_type != VAR_STRING) p_li = p_li->li_next; /* Skip non-string items */ if (!p_li) /* End of the list */ --- 532,539 ---- else if (tv->v_type == VAR_LIST) { /* Get the next line from the supplied list */ ! while (p_li && (p_li->li_tv.v_type != VAR_STRING ! || p_li->li_tv.vval.v_string == NULL)) p_li = p_li->li_next; /* Skip non-string items */ if (!p_li) /* End of the list */ *** ../vim-7.4.1663/src/testdir/test_quickfix.vim 2016-03-25 17:14:03.175330056 +0100 --- src/testdir/test_quickfix.vim 2016-03-27 18:41:16.785659221 +0200 *************** *** 692,694 **** --- 692,699 ---- endtry quit! endfunc + + func Test_cgetexpr_works() + " this must not crash Vim + cgetexpr [$x] + endfunc *** ../vim-7.4.1663/src/version.c 2016-03-27 15:13:06.962231587 +0200 --- src/version.c 2016-03-27 18:40:31.094123973 +0200 *************** *** 750,751 **** --- 750,753 ---- { /* Add new patch number below this line */ + /**/ + 1664, /**/ -- hundred-and-one symptoms of being an internet addict: 140. You'd rather catch a score on the web than watch the game as it is being played on tv. /// 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 ///