Mercurial > vim
comparison src/regexp_nfa.c @ 11896:a941848d8c44 v8.0.0828
patch 8.0.0828: Coverity: may dereference NULL pointer
commit https://github.com/vim/vim/commit/983b3a5bc44a91cc7e40b8e71e3bfdb03dd4606f
Author: Bram Moolenaar <Bram@vim.org>
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 01 Aug 2017 15:15:05 +0200 |
parents | 14b6b79d685b |
children | e769c912fcd9 |
comparison
equal
deleted
inserted
replaced
11895:16438082d51b | 11896:a941848d8c44 |
---|---|
3525 goto theend; | 3525 goto theend; |
3526 if (pattern) | 3526 if (pattern) |
3527 { | 3527 { |
3528 /* NFA_ZEND -> NFA_END_PATTERN -> NFA_SKIP -> what follows. */ | 3528 /* NFA_ZEND -> NFA_END_PATTERN -> NFA_SKIP -> what follows. */ |
3529 skip = alloc_state(NFA_SKIP, NULL, NULL); | 3529 skip = alloc_state(NFA_SKIP, NULL, NULL); |
3530 if (skip == NULL) | |
3531 goto theend; | |
3530 zend = alloc_state(NFA_ZEND, s1, NULL); | 3532 zend = alloc_state(NFA_ZEND, s1, NULL); |
3533 if (zend == NULL) | |
3534 goto theend; | |
3531 s1->out= skip; | 3535 s1->out= skip; |
3532 patch(e.out, zend); | 3536 patch(e.out, zend); |
3533 PUSH(frag(s, list1(&skip->out))); | 3537 PUSH(frag(s, list1(&skip->out))); |
3534 } | 3538 } |
3535 else | 3539 else |