]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0309: Missing out-of-memory check to may_get_cmd_block() v9.2.0309
authorJohn Marriott <basilisk@internode.on.net>
Mon, 6 Apr 2026 13:07:31 +0000 (13:07 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 6 Apr 2026 13:07:31 +0000 (13:07 +0000)
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 <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/usercmd.c
src/version.c

index c151261ec06983e65234973656ea22c1c51af9a5..cef1d18b79f4164d25dda755cff6da3cc68f431f 100644 (file)
@@ -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, "\n");
+       if (retp == NULL)
+           retp = p;
        ga_clear_strings(&ga);
        *flags |= UC_VIM9;
     }
index 4ebfc1522d68f738101d6a168eeac22a43ad08aa..628ebadacc1bcc2a698876c836aefb6e9b171a79 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    309,
 /**/
     308,
 /**/