mirror of
https://github.com/neovim/neovim.git
synced 2026-04-25 16:54:12 +00:00
vim-patch:8.0.1622: possible NULL pointer dereference
Problem: Possible NULL pointer dereferencey. (Coverity)
Solution: Reverse the check for a NULL pointer.
6ed86ad170
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user