]> granicus.if.org Git - vim/commitdiff
patch 8.1.2334: possible NULL pointer dereference in popup_locate() v8.1.2334
authorBram Moolenaar <Bram@vim.org>
Fri, 22 Nov 2019 18:22:08 +0000 (19:22 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 22 Nov 2019 18:22:08 +0000 (19:22 +0100)
Problem:    Possible NULL pointer dereference in popup_locate(). (Coverity)
Solution:   Check for NULL pointer.

src/popupwin.c
src/version.c

index efcc3959817bf8cc0ac876c5291a2a4ccf3813a1..3b808e2e3ab13b87a2ba3c6e4c911308d5da58f4 100644 (file)
@@ -2599,7 +2599,7 @@ f_popup_locate(typval_T *argvars, typval_T *rettv)
     win_T      *wp;
 
     wp = mouse_find_win(&row, &col, FIND_POPUP);
-    if (WIN_IS_POPUP(wp))
+    if (wp != NULL && WIN_IS_POPUP(wp))
        rettv->vval.v_number = wp->w_id;
 }
 
index 903734998da418c21daa99d79e5951fb97b5f299..c327f98b4b37cd1bc75f26238fac2005437b1737 100644 (file)
@@ -737,6 +737,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2334,
 /**/
     2333,
 /**/