Patch 8.2.0101

9 views
Skip to first unread message

Bram Moolenaar

unread,
Jan 8, 2020, 12:57:02 PM1/8/20
to vim...@googlegroups.com

Patch 8.2.0101
Problem: Crash when passing null object to ":echomsg".
Solution: Check for NULL pointer. (Yasuhiro Matsumoto, closes #5460)
Files: src/eval.c, src/testdir/test_messages.vim


*** ../vim-8.2.0100/src/eval.c 2020-01-04 14:32:35.522717984 +0100
--- src/eval.c 2020-01-08 18:55:54.447317092 +0100
***************
*** 5682,5687 ****
--- 5682,5688 ----
{
if (varp->v_type == VAR_LIST
|| varp->v_type == VAR_DICT
+ || varp->v_type == VAR_BLOB
|| varp->v_type == VAR_FUNC
|| varp->v_type == VAR_PARTIAL
|| varp->v_type == VAR_FLOAT)
***************
*** 6057,6062 ****
--- 6058,6069 ----
p = tv_get_string_buf(&rettv, buf);
else
p = tv_stringify(&rettv, buf);
+ if (p == NULL)
+ {
+ clear_tv(&rettv);
+ ret = FAIL;
+ break;
+ }
len = (int)STRLEN(p);
if (ga_grow(&ga, len + 2) == FAIL)
{
*** ../vim-8.2.0100/src/testdir/test_messages.vim 2019-12-28 17:10:42.265008253 +0100
--- src/testdir/test_messages.vim 2020-01-08 18:53:05.915869033 +0100
***************
*** 268,270 ****
--- 268,280 ----
call term_sendkeys(buf, ':q!')
call StopVimInTerminal(buf)
endfunc
+
+ func Test_null()
+ echom test_null_list()
+ echom test_null_dict()
+ echom test_null_blob()
+ echom test_null_job()
+ echom test_null_string()
+ echom test_null_channel()
+ echom test_null_partial()
+ endfunc
*** ../vim-8.2.0100/src/version.c 2020-01-07 21:32:15.917239304 +0100
--- src/version.c 2020-01-08 18:54:21.407624434 +0100
***************
*** 744,745 ****
--- 744,747 ----
{ /* Add new patch number below this line */
+ /**/
+ 101,
/**/

--
Biting someone with your natural teeth is "simple assault," while biting
someone with your false teeth is "aggravated assault."
[real standing law in Louisana, United States of America]

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages