]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.2.0925: crash when getcompletiontype() gets a NULL string master v9.2.0925
authorChristian Brabandt <cb@256bit.org>
Fri, 7 Aug 2026 20:22:20 +0000 (20:22 +0000)
committerChristian Brabandt <cb@256bit.org>
Fri, 7 Aug 2026 20:22:20 +0000 (20:22 +0000)
commite2dcefa0d8c03a7d2ebda67207e3d1392ae0c402
treeeb3a8ab6cb92954bf4f42a1bdcd5585eb42bcc1a
parent26a1e90a57eeed352fda62f3f4477415392a6a02
patch 9.2.0925: crash when getcompletiontype() gets a NULL string

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: #20964

Supported by AI.

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/cmdexpand.c
src/testdir/test_cmdline.vim
src/version.c