From 0b49cb67f29ecff6f7eea16063dee7e39114169a Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 29 Jan 2020 02:02:11 -0500 Subject: vim-patch:8.2.0171: fix use of uninitialized buffer #11786 Problem: Coverity warning for using uninitialized buffer. Solution: Check the skip flag. https://github.com/vim/vim/commit/9a5e5a3e33bb86ba5209278e83ec60790f80d15c --- src/nvim/eval.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nvim') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 5c6e475ac7..b3cc3282d5 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -22132,11 +22132,12 @@ ret_free: static char_u * trans_function_name( char_u **pp, - int skip, // only find the end, don't evaluate + bool skip, // only find the end, don't evaluate int flags, funcdict_T *fdp, // return: info about dictionary used partial_T **partial // return: partial of a FuncRef ) + FUNC_ATTR_NONNULL_ARG(1) { char_u *name = NULL; const char_u *start; @@ -22323,7 +22324,7 @@ trans_function_name( } name = xmalloc(len + lead + 1); - if (lead > 0){ + if (!skip && lead > 0) { name[0] = K_SPECIAL; name[1] = KS_EXTRA; name[2] = (int)KE_SNR; -- cgit