diff options
author | Karl Williamson <public@khwilliamson.com> | 2014-03-04 17:43:11 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2014-03-04 18:08:27 -0700 |
commit | 1ea8b7fed3b179aacae584e0c7389ab20fd4c388 (patch) | |
tree | db87fac8d090177cf992499cdca1b741ce85a085 | |
parent | 6ed60307ec0bd14728ad72c8f6fb4c27112cbff6 (diff) | |
download | perl-1ea8b7fed3b179aacae584e0c7389ab20fd4c388.tar.gz |
regcomp.c: Don't read uninitialized data
The blamed commit failed to check whether the data is present before
reading it.
I believe that this creates false positives in te optimizer, so no
actual failures ensued.
-rw-r--r-- | regcomp.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1271,7 +1271,9 @@ S_ssc_and(pTHX_ const RExC_state_t *pRExC_state, regnode_ssc *ssc, || (ANYOF_FLAGS(and_with) & ANYOF_POSIXL)) { /* One or the other of P1, P2 is non-empty. */ - ANYOF_POSIXL_AND((regnode_charclass_posixl*) and_with, ssc); + if (ANYOF_FLAGS(and_with) & ANYOF_POSIXL) { + ANYOF_POSIXL_AND((regnode_charclass_posixl*) and_with, ssc); + } ssc_union(ssc, anded_cp_list, FALSE); } else { /* P1 = P2 = empty */ @@ -1331,8 +1333,8 @@ S_ssc_or(pTHX_ const RExC_state_t *pRExC_state, regnode_ssc *ssc, && ! is_ANYOF_SYNTHETIC(or_with)) { /* We ignore P2, leaving P1 going forward */ - } - else { /* Not inverted */ + } /* else Not inverted */ + else if (ANYOF_FLAGS(or_with) & ANYOF_POSIXL) { ANYOF_POSIXL_OR((regnode_charclass_posixl*)or_with, ssc); if (ANYOF_POSIXL_SSC_TEST_ANY_SET(ssc)) { unsigned int i; |