diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-01-25 02:12:06 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-01-27 02:39:42 -0500 |
commit | c15e796211f04b16f58d06fe440f4009a69a1a01 (patch) | |
tree | 3ca8a669031c1af9ed41496a600e2f39601d95a0 /src/nvim/eval.c | |
parent | e1d81178ccf374e7142207356a022bdf10571918 (diff) | |
download | rneovim-c15e796211f04b16f58d06fe440f4009a69a1a01.tar.gz rneovim-c15e796211f04b16f58d06fe440f4009a69a1a01.tar.bz2 rneovim-c15e796211f04b16f58d06fe440f4009a69a1a01.zip |
coverity/125476: RI: Null pointer dereference
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 219bd38d82..33c584eede 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -10786,15 +10786,15 @@ static void f_globpath(typval_T *argvars, typval_T *rettv) } } -/* - * "glob2regpat()" function - */ +// "glob2regpat()" function static void f_glob2regpat(typval_T *argvars, typval_T *rettv) { - char_u *pat = get_tv_string_chk(&argvars[0]); + char_u *pat = get_tv_string_chk(&argvars[0]); // NULL on type error - rettv->v_type = VAR_STRING; - rettv->vval.v_string = file_pat_to_reg_pat(pat, NULL, NULL, FALSE); + rettv->v_type = VAR_STRING; + rettv->vval.v_string = (pat == NULL) + ? NULL + : file_pat_to_reg_pat(pat, NULL, NULL, false); } /* |