summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-08-01 15:14:26 +0200
committerBram Moolenaar <Bram@vim.org>2017-08-01 15:14:26 +0200
commit983b3a5bc44a91cc7e40b8e71e3bfdb03dd4606f (patch)
treecf84f10c5b0cf968e84893825fe4a5c25000ea46
parent979e8c534684737920c1891bf9c4af9e1fdb8c3b (diff)
downloadvim-git-983b3a5bc44a91cc7e40b8e71e3bfdb03dd4606f.tar.gz
patch 8.0.0828: Coverity: may dereference NULL pointerv8.0.0828
Problem: Coverity: may dereference NULL pointer. Solution: Bail out if calloc_state() returns NULL.
-rw-r--r--src/regexp_nfa.c4
-rw-r--r--src/version.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 804d742ab..40d6605f0 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -3527,7 +3527,11 @@ post2nfa(int *postfix, int *end, int nfa_calc_size)
{
/* 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
index 732e8a526..e7b9feed9 100644
--- 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,