From: zeertzjq Date: Mon, 24 Mar 2025 19:22:23 +0000 (+0100) Subject: patch 9.1.1233: Coverity warns about NULL pointer when triggering WinResized X-Git-Tag: v9.1.1233^0 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b42b9fc41f27f92aaf4f96cd4149f3160e9fe588;p=thirdparty%2Fvim.git 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 Signed-off-by: Christian Brabandt --- diff --git a/src/version.c b/src/version.c index 7ee6d0a8d8..00d10e86de 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 55168d53fe..4fb7054e5b 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;