mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 08:18: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,13 +1741,16 @@ int buflist_findpat(
|
|||||||
int toggledollar;
|
int toggledollar;
|
||||||
|
|
||||||
if (pattern_end == pattern + 1 && (*pattern == '%' || *pattern == '#')) {
|
if (pattern_end == pattern + 1 && (*pattern == '%' || *pattern == '#')) {
|
||||||
if (*pattern == '%')
|
if (*pattern == '%') {
|
||||||
match = curbuf->b_fnum;
|
match = curbuf->b_fnum;
|
||||||
else
|
} else {
|
||||||
match = curwin->w_alt_fnum;
|
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;
|
match = -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* Try four ways of matching a listed buffer:
|
* Try four ways of matching a listed buffer:
|
||||||
* attempt == 0: without '^' or '$' (at any position)
|
* attempt == 0: without '^' or '$' (at any position)
|
||||||
|
Reference in New Issue
Block a user