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:
parent
548e598573
commit
c57463c9c6
@ -3218,8 +3218,10 @@ post2nfa(int *postfix, int *end, int nfa_calc_size)
|
|||||||
|
|
||||||
if (nfa_calc_size == FALSE)
|
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);
|
stack = (Frag_T *)lalloc((nstate + 1) * sizeof(Frag_T), TRUE);
|
||||||
|
if (stack == NULL)
|
||||||
|
return NULL;
|
||||||
stackp = stack;
|
stackp = stack;
|
||||||
stack_end = stack + (nstate + 1);
|
stack_end = stack + (nstate + 1);
|
||||||
}
|
}
|
||||||
|
@ -799,6 +799,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
641,
|
||||||
/**/
|
/**/
|
||||||
640,
|
640,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user