diff options
author | James McCoy <jamessan@jamessan.com> | 2021-05-05 23:08:46 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2021-05-06 18:56:56 -0400 |
commit | f6d4226f4d121e79e05f843eabd72cbdda8b215b (patch) | |
tree | 051f74a3ae4519af2d5a8781085d65a2a236e8f5 | |
parent | 833a6fcb6095254abae92a2309d7c3ce0e603bf3 (diff) | |
download | rneovim-f6d4226f4d121e79e05f843eabd72cbdda8b215b.tar.gz rneovim-f6d4226f4d121e79e05f843eabd72cbdda8b215b.tar.bz2 rneovim-f6d4226f4d121e79e05f843eabd72cbdda8b215b.zip |
coverity/188735: last_nonfloat: Ensure wp is non-NULL before dereferencing
-rw-r--r-- | src/nvim/window.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index d8a8f31d05..c070f0a32e 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -2199,7 +2199,7 @@ bool one_nonfloat(void) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT /// always false for a floating window bool last_nonfloat(win_T *wp) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { - return firstwin == wp && !(wp->w_next && !wp->w_floating); + return wp != NULL && firstwin == wp && !(wp->w_next && !wp->w_floating); } /// Close the possibly last window in a tab page. |