mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.0.0828: Coverity: may dereference NULL pointer
Problem: Coverity: may dereference NULL pointer.
Solution: Bail out if calloc_state() returns NULL.
983b3a5bc4
This commit is contained in:
parent
22311457ab
commit
dd6c1a0a8f
@ -3224,7 +3224,13 @@ static nfa_state_T *post2nfa(int *postfix, int *end, int nfa_calc_size)
|
|||||||
if (pattern) {
|
if (pattern) {
|
||||||
/* NFA_ZEND -> NFA_END_PATTERN -> NFA_SKIP -> what follows. */
|
/* NFA_ZEND -> NFA_END_PATTERN -> NFA_SKIP -> what follows. */
|
||||||
skip = alloc_state(NFA_SKIP, NULL, NULL);
|
skip = alloc_state(NFA_SKIP, NULL, NULL);
|
||||||
|
if (skip == NULL) {
|
||||||
|
goto theend;
|
||||||
|
}
|
||||||
zend = alloc_state(NFA_ZEND, s1, NULL);
|
zend = alloc_state(NFA_ZEND, s1, NULL);
|
||||||
|
if (zend == NULL) {
|
||||||
|
goto theend;
|
||||||
|
}
|
||||||
s1->out= skip;
|
s1->out= skip;
|
||||||
patch(e.out, zend);
|
patch(e.out, zend);
|
||||||
PUSH(frag(s, list1(&skip->out)));
|
PUSH(frag(s, list1(&skip->out)));
|
||||||
|
Loading…
Reference in New Issue
Block a user