From ac0585270cf81b0a8bdfecaca72e13e935148762 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 16 Jun 2026 07:19:38 -0400 Subject: [PATCH] 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 https://github.com/vim/vim/commit/362be6ba2700e864f3c755d2366a8088bead21fa Co-authored-by: Christian Brabandt --- src/nvim/cmdexpand.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index 48b71fcaee..439c1217f0 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -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