aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-01-29 02:02:11 -0500
committerGitHub <noreply@github.com>2020-01-28 23:02:11 -0800
commit0b49cb67f29ecff6f7eea16063dee7e39114169a (patch)
tree4b4477a37663e37817eb433013bf80b036b49b19
parent01ff9db633fccc7099d71cfe48b8d77a2f638326 (diff)
downloadrneovim-0b49cb67f29ecff6f7eea16063dee7e39114169a.tar.gz
rneovim-0b49cb67f29ecff6f7eea16063dee7e39114169a.tar.bz2
rneovim-0b49cb67f29ecff6f7eea16063dee7e39114169a.zip
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
-rw-r--r--src/nvim/eval.c5
1 files changed, 3 insertions, 2 deletions
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;