patch 9.2.0309: Missing out-of-memory check to may_get_cmd_block()
Commit:
https://github.com/vim/vim/commit/4368ad34df6d993f0deea6242bdabb1e56299fa0
Author: John Marriott <
basi...@internode.on.net>
Date: Mon Apr 6 13:07:31 2026 +0000
patch 9.2.0309: Missing out-of-memory check to may_get_cmd_block()
Problem: Missing out-of-memory check to may_get_cmd_block()
Solution: Return p unchanged in case of out-of-memory (John Marriott)
closes: #19906
Signed-off-by: John Marriott <
basi...@internode.on.net>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/src/usercmd.c b/src/usercmd.c
index c151261ec..cef1d18b7 100644
--- a/src/usercmd.c
+++ b/src/usercmd.c
@@ -1240,6 +1240,8 @@ may_get_cmd_block(exarg_T *eap, char_u *p, char_u **tofree, int *flags)
}
vim_free(line);
retp = *tofree = ga_concat_strings(&ga, "
");
+ if (retp == NULL)
+ retp = p;
ga_clear_strings(&ga);
*flags |= UC_VIM9;
}
diff --git a/src/version.c b/src/version.c
index 4ebfc1522..628ebadac 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 309,
/**/
308,
/**/