0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.1.0641: no check for out-of-memory when converting regexp

Problem:    No check for out-of-memory when converting regexp.
Solution:   Bail out when lalloc() returns NULL. (John Marriott)
This commit is contained in:
Bram Moolenaar 2018-12-26 22:04:41 +01:00
parent 548e598573
commit c57463c9c6
2 changed files with 5 additions and 1 deletions

View File

@ -3218,8 +3218,10 @@ post2nfa(int *postfix, int *end, int nfa_calc_size)
if (nfa_calc_size == FALSE)
{
/* Allocate space for the stack. Max states on the stack : nstate */
// Allocate space for the stack. Max states on the stack: "nstate'.
stack = (Frag_T *)lalloc((nstate + 1) * sizeof(Frag_T), TRUE);
if (stack == NULL)
return NULL;
stackp = stack;
stack_end = stack + (nstate + 1);
}

View File

@ -799,6 +799,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
641,
/**/
640,
/**/