From: Karl Williamson Date: Fri, 15 Jan 2010 00:36:46 +0000 (-0700) Subject: Add tested for corrupted regnode X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=35db910f236b637e47a514ee62ca3e5a98169ddd;p=p5sagit%2Fp5-mst-13.2.git Add tested for corrupted regnode --- diff --git a/regcomp.c b/regcomp.c index c290fbd..ff9c582 100644 --- a/regcomp.c +++ b/regcomp.c @@ -9866,6 +9866,10 @@ Perl_regnext(pTHX_ register regnode *p) if (!p) return(NULL); + if (OP(p) > REGNODE_MAX) { /* regnode.type is unsigned */ + Perl_croak(aTHX_ "Corrupted regexp opcode %d > %d", (int)OP(p), (int)REGNODE_MAX); + } + offset = (reg_off_by_arg[OP(p)] ? ARG(p) : NEXT_OFF(p)); if (offset == 0) return(NULL);