vim-patch:9.1.1335: Coverity complains about Null pointer dereferences #40280

Problem:  Coverity complains about Null pointer dereferences
Solution: before accessing ccline->cmdbuff check that ccline is not NULL

Fixes: Coverity issue 1646601
closes: vim/vim#17189

362be6ba27

Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Jan Edmund Lazo
2026-06-16 07:19:38 -04:00
committed by GitHub
parent 72ba16f819
commit ac0585270c

View File

@@ -385,8 +385,9 @@ int nextwild(expand_T *xp, int type, int options, bool escape)
}
/// Create completion popup menu with items from "matches".
static void cmdline_pum_create(CmdlineInfo *ccline, expand_T *xp, char **matches, int numMatches,
bool showtail, bool cmdline_unchanged)
static void cmdline_pum_create(const CmdlineInfo *ccline, expand_T *xp, char **matches,
int numMatches, bool showtail, bool cmdline_unchanged)
FUNC_ATTR_NONNULL_ARG(1, 2)
{
assert(numMatches >= 0);
// Add all the completion matches