Commit: patch 9.1.1335: Coverity complains about Null pointer dereferences

2 views
Skip to first unread message

Christian Brabandt

unread,
Apr 22, 2025, 2:15:15 PM4/22/25
to vim...@googlegroups.com
patch 9.1.1335: Coverity complains about Null pointer dereferences

Commit: https://github.com/vim/vim/commit/362be6ba2700e864f3c755d2366a8088bead21fa
Author: Christian Brabandt <c...@256bit.org>
Date: Tue Apr 22 20:06:53 2025 +0200

patch 9.1.1335: Coverity complains about Null pointer dereferences

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 <c...@256bit.org>

diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 5b87d7804..e8bc0805c 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -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)
{
diff --git a/src/version.c b/src/version.c
index 1a17d2e4c..2d36034ab 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 */
+/**/
+ 1335,
/**/
1334,
/**/
Reply all
Reply to author
Forward
0 new messages