This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
525aa62
)
Add tested for corrupted regnode
author
Karl Williamson
<khw@khw-desktop.(none)>
Fri, 15 Jan 2010 00:36:46 +0000
(17:36 -0700)
committer
Craig A. Berry
<craigberry@mac.com>
Sat, 29 May 2010 15:40:18 +0000
(10:40 -0500)
regcomp.c
patch
|
blob
|
blame
|
history
diff --git
a/regcomp.c
b/regcomp.c
index
c290fbd
..
ff9c582
100644
(file)
--- 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);