From 06e53aa487d3a36a18ece4b639801bc5c59bd0be Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 19 Feb 2016 00:20:34 -0500 Subject: 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. --- src/nvim/buffer.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/nvim') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 9806623433..c05090bbf6 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -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: -- cgit From 156df2c81b7bc79a4a665bdaa017ccfb2b565304 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 19 Feb 2016 00:24:53 -0500 Subject: coverity/135593: Error handling issues (CHECKED_RETURN) Harmless issue (HI): retval is intentionally ignored, as is the wont of didset_options() and friends. --- src/nvim/option.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim') diff --git a/src/nvim/option.c b/src/nvim/option.c index 4bf7ec5405..0f6874e941 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -2077,7 +2077,7 @@ static void didset_options2(void) (void)highlight_changed(); // Parse default for 'clipboard'. - opt_strings_flags(p_cb, p_cb_values, &cb_flags, true); + (void)opt_strings_flags(p_cb, p_cb_values, &cb_flags, true); // Parse default for 'fillchars'. (void)set_chars_option(&p_fcs); -- cgit