This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In S_regatom(), set flags to 0 at the start.
authorNicholas Clark <nick@ccl4.org>
Sat, 12 Jan 2013 10:45:26 +0000 (11:45 +0100)
committerNicholas Clark <nick@ccl4.org>
Sat, 12 Jan 2013 10:53:16 +0000 (11:53 +0100)
Without this, flags will be read uninitialised for the execution path that
ends up with "Internal urp". (Although it's not clear that that error message
is ever reachable.)

The bug was introduced in perl 5.000, which added (?#) comments and (?m)
style embedding flags. It's not present in alpha 9.

regcomp.c

index a57f462..06b9f79 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -10056,7 +10056,7 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
 {
     dVAR;
     regnode *ret = NULL;
-    I32 flags;
+    I32 flags = 0;
     char *parse_start = RExC_parse;
     U8 op;
     int invert = 0;