]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1233: Coverity warns about NULL pointer when triggering WinResized v9.1.1233
authorzeertzjq <zeertzjq@outlook.com>
Mon, 24 Mar 2025 19:22:23 +0000 (20:22 +0100)
committerChristian Brabandt <cb@256bit.org>
Mon, 24 Mar 2025 19:22:23 +0000 (20:22 +0100)
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 <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/version.c
src/window.c

index 7ee6d0a8d80e21d9f4bc54c679b6c09fb970ddf1..00d10e86de41f233b28d23242b951ab7d420d7ff 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1233,
 /**/
     1232,
 /**/
index 55168d53fe8831fc15f7a4896f86dbc797b29fdb..4fb7054e5b28691370402f9241e311d0695676b5 100644 (file)
@@ -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;