This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: (Coverity) add NULL check
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 13 Apr 2006 15:52:15 +0000 (18:52 +0300)
committerNicholas Clark <nick@ccl4.org>
Thu, 13 Apr 2006 13:53:55 +0000 (13:53 +0000)
Message-Id: <200604131252.k3DCqFUL497781@kosh.hut.fi>
Date: Thu, 13 Apr 2006 15:52:15 +0300 (EEST)

p4raw-id: //depot/perl@27789

regexec.c

index 399410f..284fe7e 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -3780,7 +3780,7 @@ S_regmatch(pTHX_ regexp *rex, regnode *prog)
            {
                I32 type;
                type = OP(scan);
-               if (OP(next) != type)   /* No choice. */
+               if (!next || OP(next) != type)  /* No choice. */
                    next = inner;       /* Avoid recursion. */
                else {
                    const I32 lastparen = *PL_reglastparen;