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:
37405f9
)
[perl #32041] SEGV with complicated regexp and long string
author
Dave Mitchell
<davem@fdisolutions.com>
Sat, 20 May 2006 00:43:42 +0000
(
00:43
+0000)
committer
Dave Mitchell
<davem@fdisolutions.com>
Sat, 20 May 2006 00:43:42 +0000
(
00:43
+0000)
PL_reg_maxiter was wrapping to a negative value
p4raw-id: //depot/perl@28248
regexec.c
patch
|
blob
|
blame
|
history
diff --git
a/regexec.c
b/regexec.c
index
f765024
..
0f5d6fb
100644
(file)
--- a/
regexec.c
+++ b/
regexec.c
@@
-3652,6
+3652,9
@@
S_regmatch(pTHX_ const regmatch_info *reginfo, regnode *prog)
*that* much linear. */
if (!PL_reg_maxiter) {
PL_reg_maxiter = (PL_regeol - PL_bostr + 1) * (scan->flags>>4);
+ /* possible overflow for long strings and many CURLYX's */
+ if (PL_reg_maxiter < 0)
+ PL_reg_maxiter = I32_MAX;
PL_reg_leftiter = PL_reg_maxiter;
}
if (PL_reg_leftiter-- == 0) {