This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Save and restore PL_regeol for op inside of regex (RT ##66110)
authorCraig A. Berry <craigberry@mac.com>
Sat, 25 Jul 2009 19:06:34 +0000 (14:06 -0500)
committerCraig A. Berry <craigberry@mac.com>
Sat, 25 Jul 2009 19:49:12 +0000 (14:49 -0500)
commitd80618d26460a93181dddc9ec53c3fceef864290
tree46b47dbff549a67a4e5f36afa79983b38d440210
parentb7bfa855cd96849c1ce8b7e9624b69c94149aacc
Save and restore PL_regeol for op inside of regex (RT ##66110)

If the op inside of a (?{ }) construct is another regex, the two
regexen end up corrupting each others' end-of-string markers,
resulting in various pathologies including access violations,
stack corruptions, and memory use growing without bound.

The change here is intended to be a relatively safe, cheap way to
prevent memory errors and makes no attempt to save and restore
other aspects of regex state; i.e., general purpose reentrancy
for the regex engine is still a TODO.
regexec.c