This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(tentative) regcomp.c: try convincing Coverity that data ptr in study_chunk is non...
authorJarkko Hietaniemi <jhi@iki.fi>
Sun, 16 Apr 2006 12:26:48 +0000 (15:26 +0300)
committerNicholas Clark <nick@ccl4.org>
Mon, 17 Apr 2006 13:38:30 +0000 (13:38 +0000)
Message-Id: <20060416092648.812D36CF2D@aprikoosi.hut.fi>
Date: Sun, 16 Apr 2006 12:26:48 +0300 (EEST)

p4raw-id: //depot/perl@27869

regcomp.c

index 663b343..a820e5a 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -1733,6 +1733,8 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, I32 *deltap,
                }
                if (code == IFTHEN && num < 2) /* Empty ELSE branch */
                    min1 = 0;
+               if ((flags & (SCF_DO_SUBSTR | SCF_DO_STCLASS)) && !data)
+                   Perl_croak(aTHX_ "panic: null data in study_chunk");
                if (flags & SCF_DO_SUBSTR) {
                    data->pos_min += min1;
                    data->pos_delta += max1 - min1;