(tentative) regcomp.c: try convincing Coverity that data ptr in study_chunk is non...
Jarkko Hietaniemi [Sun, 16 Apr 2006 12:26:48 +0000 (15:26 +0300)]
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;