diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-23 00:57:57 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-23 08:34:26 -0400 |
commit | 6285b518d4c56537991feff899b74274766086ca (patch) | |
tree | f59c5bff5a152f122945ecd0d1c1730ae4bcff71 | |
parent | 84b8612987320f722c33dff3a3f16930407c62ce (diff) | |
download | rneovim-6285b518d4c56537991feff899b74274766086ca.tar.gz rneovim-6285b518d4c56537991feff899b74274766086ca.tar.bz2 rneovim-6285b518d4c56537991feff899b74274766086ca.zip |
vim-patch:8.0.1622: possible NULL pointer dereference
Problem: Possible NULL pointer dereferencey. (Coverity)
Solution: Reverse the check for a NULL pointer.
https://github.com/vim/vim/commit/6ed86ad170b60517eeddb54c2b22fdc888a22c0b
-rw-r--r-- | src/nvim/quickfix.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 47760e1e70..664dd3e968 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -3603,15 +3603,16 @@ void ex_vimgrep(exarg_T *eap) goto theend; } - if (s != NULL && *s == NUL) { - /* Pattern is empty, use last search pattern. */ + if (s == NULL || *s == NUL) { + // Pattern is empty, use last search pattern. if (last_search_pat() == NULL) { EMSG(_(e_noprevre)); goto theend; } regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC); - } else + } else { regmatch.regprog = vim_regcomp(s, RE_MAGIC); + } if (regmatch.regprog == NULL) goto theend; |