This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #78040] regcomp.c: malloc enough space
authorKarl Williamson <public@khwilliamson.com>
Wed, 29 Sep 2010 19:50:52 +0000 (13:50 -0600)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 30 Sep 2010 02:56:32 +0000 (19:56 -0700)
commitc5ea2ffada6b35a5d11ced4772d80ebcf2f0bc9e
tree2d5cfa7fad11ce89702117c274a8957cd3f6c180
parent6562f1c45edaedf59c6314953f308718b62e67d7
[perl #78040] regcomp.c: malloc enough space

Commit 9de15fec376a8ff90a38fad0ff322c72c2995765 introduced /u, /d, and
/l regex modifiers.  Unfortunately, I forgot to adequately account for
them in the space required for the stringification of the regex.

This patch figures out separately if the caret is needed, and if one of
these charset modifiers is needed, and allocates space accordingly.

I could not figure out a simple test case for this fix.  valgrind
prior to this will show errors, and after this doesn't.
regcomp.c