This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: update RExC_start when parsing outside input
authorKarl Williamson <khw@cpan.org>
Tue, 22 Dec 2015 03:38:14 +0000 (20:38 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 22 Dec 2015 20:16:52 +0000 (13:16 -0700)
commit693ceb05538496aff79244ad7529bc8d153302a8
tree7b28b803f90552947ebe2dc0f637e3bf07f195b7
parent711b303b46e294e0fd67c7f4f1c7a525c6ca76b4
regcomp.c: update RExC_start when parsing outside input

I noticed this while code reading.  In places, regcomp parses not the
input pattern but a temporary buffer it constructs, based on that input
pattern.  RExC_start should be updated so it always is pointing to the
same buffer as the parse pointer; otherwise segfaults can happen.

I have no idea how one currently can get into the situation this
protects against, so there are no tests added.
regcomp.c