develooper Front page | perl.perl5.porters | Postings from April 2006

[PATCH] (tentative) regcomp.c: try convincing Coverity that data ptr in study_chunk is non-NULL when needed

Thread Next
From:
jhi
Date:
April 16, 2006 02:27
Subject:
[PATCH] (tentative) regcomp.c: try convincing Coverity that data ptr in study_chunk is non-NULL when needed
Message ID:
20060416092648.812D36CF2D@aprikoosi.hut.fi
--- regcomp.c.dist	2006-04-16 11:52:20.000000000 +0300
+++ regcomp.c	2006-04-16 12:24:59.000000000 +0300
@@ -1733,6 +1733,8 @@
 		}
 		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;

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About