changeset 18685:ff4174f1ed3a v8.1.2334

patch 8.1.2334: possible NULL pointer dereference in popup_locate() Commit: https://github.com/vim/vim/commit/fd318115a5ee813cba69aa7fc7f5f42f08f10ee4 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Nov 22 19:22:08 2019 +0100 patch 8.1.2334: possible NULL pointer dereference in popup_locate() Problem: Possible NULL pointer dereference in popup_locate(). (Coverity) Solution: Check for NULL pointer.
author Bram Moolenaar <Bram@vim.org>
date Fri, 22 Nov 2019 19:30:04 +0100
parents 713c3edb1147
children 1a24a050315a
files src/popupwin.c src/version.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -2599,7 +2599,7 @@ f_popup_locate(typval_T *argvars, typval
     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;
 }
 
--- a/src/version.c
+++ b/src/version.c
@@ -738,6 +738,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2334,
+/**/
     2333,
 /**/
     2332,