patch 9.1.1233: Coverity warns about NULL pointer when triggering WinResized
Commit: https://github.com/vim/vim/commit/b42b9fc41f27f92aaf4f96cd4149f3160e9fe588 Author: zeertzjq <zeert...@outlook.com> Date: Mon Mar 24 20:22:23 2025 +0100 patch 9.1.1233: Coverity warns about NULL pointer when triggering WinResized Problem: Coverity warns about NULL pointer when triggering WinResized Solution: Add OOM checks for windows_list like for scroll_dict. Remove void casts that are unnecessary after 9.1.1084 (zeertzjq). closes: #16959 Signed-off-by: zeertzjq <zeert...@outlook.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/src/version.c b/src/version.c index 7ee6d0a8d..00d10e86d 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1233, /**/ 1232, /**/ diff --git a/src/window.c b/src/window.c index 55168d53f..4fb7054e5 100644 --- a/src/window.c +++ b/src/window.c @@ -3285,7 +3285,8 @@ may_trigger_win_scrolled_resized(void) { // Create the list for v:event.windows before making the snapshot. windows_list = list_alloc_with_items(size_count); - (void)check_window_scroll_resize(NULL, NULL, NULL, windows_list, NULL); + if (windows_list != NULL) + check_window_scroll_resize(NULL, NULL, NULL, windows_list, NULL); } dict_T *scroll_dict = NULL; @@ -3296,8 +3297,7 @@ may_trigger_win_scrolled_resized(void) if (scroll_dict != NULL) { scroll_dict->dv_refcount = 1; - (void)check_window_scroll_resize(NULL, NULL, NULL, NULL, - scroll_dict); + check_window_scroll_resize(NULL, NULL, NULL, NULL, scroll_dict); } } #endif @@ -3314,7 +3314,11 @@ may_trigger_win_scrolled_resized(void) recursive = TRUE; // If both are to be triggered do WinResized first. - if (trigger_resize) + if (trigger_resize +#ifdef FEAT_EVAL + && windows_list != NULL +#endif + ) { #ifdef FEAT_EVAL save_v_event_T save_v_event; -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1twnUq-00DFei-4C%40256bit.org.