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:
Justin M. Keyes
2016-02-19 00:20:34 -05:00
parent 91254bd9d8
commit 06e53aa487

View File

@@ -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: