mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
vim-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)
c57463c9c6
This commit is contained in:
@@ -3002,8 +3002,8 @@ static nfa_state_T *post2nfa(int *postfix, int *end, int nfa_calc_size)
|
|||||||
return NULL; \
|
return NULL; \
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = xmalloc((nstate + 1) * sizeof(Frag_T));
|
stack = xmalloc((nstate + 1) * sizeof(Frag_T));
|
||||||
stackp = stack;
|
stackp = stack;
|
||||||
stack_end = stack + (nstate + 1);
|
stack_end = stack + (nstate + 1);
|
||||||
|
Reference in New Issue
Block a user