# HG changeset patch # User Christian Brabandt # Date 1501593305 -7200 # Node ID a941848d8c445899cb3caa1bec9610b5a1c6ebc5 # Parent 16438082d51b18e51a84678a46a78bf352aa4d71 patch 8.0.0828: Coverity: may dereference NULL pointer commit https://github.com/vim/vim/commit/983b3a5bc44a91cc7e40b8e71e3bfdb03dd4606f Author: Bram Moolenaar Date: Tue Aug 1 15:14:26 2017 +0200 patch 8.0.0828: Coverity: may dereference NULL pointer Problem: Coverity: may dereference NULL pointer. Solution: Bail out if calloc_state() returns NULL. diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -3527,7 +3527,11 @@ post2nfa(int *postfix, int *end, int nfa { /* NFA_ZEND -> NFA_END_PATTERN -> NFA_SKIP -> what follows. */ skip = alloc_state(NFA_SKIP, NULL, NULL); + if (skip == NULL) + goto theend; zend = alloc_state(NFA_ZEND, s1, NULL); + if (zend == NULL) + goto theend; s1->out= skip; patch(e.out, zend); PUSH(frag(s, list1(&skip->out))); diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -770,6 +770,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 828, +/**/ 827, /**/ 826,