mirror of
https://github.com/neovim/neovim.git
synced 2025-09-15 15:58:17 +00:00
coverity/135589: (FP) Null pointer dereferences
False positive: buflist_findnr() should not be NULL in this case because it is given a buffer number that (should be) guaranteed to exist.
This commit is contained in:
@@ -1741,12 +1741,15 @@ int buflist_findpat(
|
||||
int toggledollar;
|
||||
|
||||
if (pattern_end == pattern + 1 && (*pattern == '%' || *pattern == '#')) {
|
||||
if (*pattern == '%')
|
||||
if (*pattern == '%') {
|
||||
match = curbuf->b_fnum;
|
||||
else
|
||||
} else {
|
||||
match = curwin->w_alt_fnum;
|
||||
if (diffmode && !diff_mode_buf(buflist_findnr(match)))
|
||||
}
|
||||
buf_T *found_buf = buflist_findnr(match);
|
||||
if (diffmode && !(found_buf && diff_mode_buf(found_buf))) {
|
||||
match = -1;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Try four ways of matching a listed buffer:
|
||||
|
Reference in New Issue
Block a user