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 <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2025-04-22 20:06:53 +02:00
parent d847b241f5
commit 362be6ba27
2 changed files with 3 additions and 1 deletions

View 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)
{