mirror of
https://github.com/neovim/neovim.git
synced 2024-12-21 03:35:02 -07: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:
parent
84b8612987
commit
6285b518d4
@ -3603,15 +3603,16 @@ void ex_vimgrep(exarg_T *eap)
|
|||||||
goto theend;
|
goto theend;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s != NULL && *s == NUL) {
|
if (s == NULL || *s == NUL) {
|
||||||
/* Pattern is empty, use last search pattern. */
|
// Pattern is empty, use last search pattern.
|
||||||
if (last_search_pat() == NULL) {
|
if (last_search_pat() == NULL) {
|
||||||
EMSG(_(e_noprevre));
|
EMSG(_(e_noprevre));
|
||||||
goto theend;
|
goto theend;
|
||||||
}
|
}
|
||||||
regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC);
|
regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC);
|
||||||
} else
|
} else {
|
||||||
regmatch.regprog = vim_regcomp(s, RE_MAGIC);
|
regmatch.regprog = vim_regcomp(s, RE_MAGIC);
|
||||||
|
}
|
||||||
|
|
||||||
if (regmatch.regprog == NULL)
|
if (regmatch.regprog == NULL)
|
||||||
goto theend;
|
goto theend;
|
||||||
|
Loading…
Reference in New Issue
Block a user