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 <[email protected]>
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 <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

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,
 /**/

-- 
-- 
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/E1w9jnE-006rqT-Cf%40256bit.org.

Raspunde prin e-mail lui