]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1335: Coverity complains about Null pointer dereferences v9.1.1335
authorChristian Brabandt <cb@256bit.org>
Tue, 22 Apr 2025 18:06:53 +0000 (20:06 +0200)
committerChristian Brabandt <cb@256bit.org>
Tue, 22 Apr 2025 18:06:53 +0000 (20:06 +0200)
Problem:  Coverity complains about Null pointer dereferences
Solution: before accessing ccline->cmdbuff check that ccline is not NULL

Fixes: Coverity issue 1646601
closes: #17189

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/cmdexpand.c
src/version.c

index 5b87d7804a612388295e0d7e3c25f2fff07cd35a..e8bc0805ca59661585f89be62967f087e3a79020 100644 (file)
@@ -382,7 +382,7 @@ cmdline_pum_create(
     }
 
     // Compute the popup menu starting column
-    compl_startcol = vim_strsize(ccline->cmdbuff) + 1;
+    compl_startcol = ccline == NULL ? 0 : vim_strsize(ccline->cmdbuff) + 1;
     columns = vim_strsize(xp->xp_pattern);
     if (showtail)
     {
index 1a17d2e4c730589ffa275aebddf54a33510992e2..2d36034abdc12dda5f84280c0181be0b61c9d7c7 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1335,
 /**/
     1334,
 /**/