[vim/vim] patch 9.2.XXXX: crash when getcompletiontype() gets a NULL string (PR #20964)

Christian Brabandt (Vim Github Repository) <[email protected]> Thu, 06 Aug 2026 12:54:52 -0700
Newsgroups gmane.editors.vim.devel
Message-ID <vim/vim/pull/[email protected]>
Problem:  Crash when getcompletiontype()/getcompletion() gets a NULL string
          (dvaave2025).
Solution: Do not write the NUL terminator in set_cmd_context() when the
          cursor column is at or past the end of the string, since the
          string may be a read-only literal.

fixes:  #20963
closes: #PR

Supported by AI.
You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20964

-- Commit Summary --

  * patch 9.2.XXXX: crash when getcompletiontype() gets a NULL string

-- File Changes --

    M src/cmdexpand.c (14)
    M src/testdir/test_cmdline.vim (5)

-- Patch Links --

https://github.com/vim/vim/pull/20964.patch
https://github.com/vim/vim/pull/20964.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/20964
You are receiving this because you are subscribed to this thread.

Message ID: <vim/vim/pull/[email protected]>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/20964%40github.com.