]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1846: [security] crash in fullcommand v9.0.1846
authorChristian Brabandt <cb@256bit.org>
Sat, 2 Sep 2023 17:30:03 +0000 (19:30 +0200)
committerChristian Brabandt <cb@256bit.org>
Sat, 2 Sep 2023 17:30:03 +0000 (19:30 +0200)
Problem:  crash in fullcommand
Solution: Check for typeval correctly

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/ex_docmd.c
src/testdir/test_functions.vim
src/version.c

index 32d52ab21218092981b8f485647070da252b8657..10d979d493ac7c66a2f808c9369bcbeb84d27fd1 100644 (file)
@@ -4087,7 +4087,7 @@ f_fullcommand(typval_T *argvars, typval_T *rettv)
                || check_for_opt_bool_arg(argvars, 1) == FAIL))
        return;
 
-    name = argvars[0].vval.v_string;
+    name = tv_get_string(&argvars[0]);
     if (name == NULL)
        return;
 
index 0eda5de380e9d087538e40495b6b27e33add6a15..ab1dbf3b59851776833ea903567d398d3dad3aa6 100644 (file)
@@ -3607,4 +3607,9 @@ func Test_string_reverse()
   let &encoding = save_enc
 endfunc
 
+func Test_fullcommand()
+  " this used to crash vim
+  call assert_equal('', fullcommand(10))
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
index 3de6046ffb02f577d97308e24423f9b574a45941..5cde7c18552595405b8792a9df59112fbf69604c 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1846,
 /**/
     1845,
 /**/