]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.1476: missing out-of-memory checks in cmdexpand.c v9.1.1476
authorJohn Marriott <basilisk@internode.on.net>
Mon, 23 Jun 2025 17:57:29 +0000 (19:57 +0200)
committerChristian Brabandt <cb@256bit.org>
Mon, 23 Jun 2025 17:57:29 +0000 (19:57 +0200)
commit1be5b375c4446976eb5a0a90d2cfa1d2d289a6ed
tree4ee9d42aba6dcf4c01acb297d6cc60bf45737b8f
parent5bbdd0b082344e77899585db66cfadb32b9186f9
patch 9.1.1476: missing out-of-memory checks in cmdexpand.c

Problem:  missing out-of-memory checks in cmdexpand.c
Solution: add missing out-of-memory checks, re-order code
          (John Marriott)

This commit does the following:
- in cmdline_pum_create() add out-of-memory check call of ALLOC_MULT()
- in expand_cmdline() move check for out-of-memory to cover both
  assignments of file_str
- in nextwild() don't free `p2` until after it's last use.

closes: #17592

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/cmdexpand.c
src/version.c