neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 36cb3262b93d8e60f9c5bffc8c820838860b302c
parent 272c4fba8386ccc17706647c6b28fa70f43e1e66
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Sun,  3 Sep 2023 10:05:45 +0800

Merge pull request #24991 from zeertzjq/vim-9.0.1846

vim-patch:9.0.{1846,1847}
Diffstat:
Msrc/nvim/ex_docmd.c | 2+-
Msrc/nvim/ops.c | 2+-
Mtest/old/testdir/test_functions.vim | 5+++++
3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c @@ -3136,7 +3136,7 @@ int cmd_exists(const char *const name) /// "fullcommand" function void f_fullcommand(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) { - char *name = argvars[0].vval.v_string; + char *name = (char *)tv_get_string(&argvars[0]); rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; diff --git a/src/nvim/ops.c b/src/nvim/ops.c @@ -4770,7 +4770,7 @@ int do_addsub(int op_type, pos_T *pos, int length, linenr_T Prenum1) } } - while (bits > 0) { + while (bits > 0 && i < NUMBUFLEN - 1) { buf2[i++] = ((n >> --bits) & 0x1) ? '1' : '0'; } diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim @@ -3273,4 +3273,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