Skip to content

Commit 4368ad3

Browse files
John Marriottchrisbra
authored andcommitted
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]>
1 parent f1dbca2 commit 4368ad3

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/usercmd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,8 @@ may_get_cmd_block(exarg_T *eap, char_u *p, char_u **tofree, int *flags)
12401240
}
12411241
vim_free(line);
12421242
retp = *tofree = ga_concat_strings(&ga, "\n");
1243+
if (retp == NULL)
1244+
retp = p;
12431245
ga_clear_strings(&ga);
12441246
*flags |= UC_VIM9;
12451247
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
309,
737739
/**/
738740
308,
739741
/**/

0 commit comments

Comments
 (0)