mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 08:48:16 +00:00
vim-patch:8.0.1500: possible NULL pointer dereference
Problem: Possible NULL pointer dereference. (Coverity)
Solution: Check for the pointer not being NULL.
0549a1e184
This commit is contained in:
@@ -3296,7 +3296,7 @@ void ex_make(exarg_T *eap)
|
|||||||
if (au_name != NULL) {
|
if (au_name != NULL) {
|
||||||
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
|
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
|
||||||
curbuf->b_fname, TRUE, curbuf);
|
curbuf->b_fname, TRUE, curbuf);
|
||||||
if (qi->qf_curlist < qi->qf_listcount)
|
if (qi != NULL && qi->qf_curlist < qi->qf_listcount)
|
||||||
res = qi->qf_lists[qi->qf_curlist].qf_count;
|
res = qi->qf_lists[qi->qf_curlist].qf_count;
|
||||||
else
|
else
|
||||||
res = 0;
|
res = 0;
|
||||||
@@ -3652,13 +3652,15 @@ void ex_cfile(exarg_T *eap)
|
|||||||
if (res >= 0 && qi != NULL) {
|
if (res >= 0 && qi != NULL) {
|
||||||
qf_list_changed(qi, qi->qf_curlist);
|
qf_list_changed(qi, qi->qf_curlist);
|
||||||
}
|
}
|
||||||
unsigned save_qfid = qi->qf_lists[qi->qf_curlist].qf_id;
|
unsigned save_qfid;
|
||||||
|
if (qi != NULL)
|
||||||
|
save_qfid = qi->qf_lists[qi->qf_curlist].qf_id;
|
||||||
if (au_name != NULL) {
|
if (au_name != NULL) {
|
||||||
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, NULL, false, curbuf);
|
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, NULL, false, curbuf);
|
||||||
}
|
}
|
||||||
// Autocmd might have freed the quickfix/location list. Check whether it is
|
// Autocmd might have freed the quickfix/location list. Check whether it is
|
||||||
// still valid
|
// still valid
|
||||||
if (!qflist_valid(wp, save_qfid)) {
|
if (qi != NULL && !qflist_valid(wp, save_qfid)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (res > 0 && (eap->cmdidx == CMD_cfile || eap->cmdidx == CMD_lfile)) {
|
if (res > 0 && (eap->cmdidx == CMD_cfile || eap->cmdidx == CMD_lfile)) {
|
||||||
|
Reference in New Issue
Block a user