diff options
author | Karl Williamson <khw@cpan.org> | 2018-02-02 15:14:27 -0700 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2018-03-23 19:33:30 +0000 |
commit | 510cc261d965ccfa427900ebb368fc4d337442d2 (patch) | |
tree | 66284f9a5bf49dc4123ab2ef2c31b6ba594a034a | |
parent | f65da1ca2eee74696d9c120e9d69af37b4fa1920 (diff) | |
download | perl-510cc261d965ccfa427900ebb368fc4d337442d2.tar.gz |
(perl #132227) restart a node if we change to uni rules within the node and encounter a sharp S
This could lead to a buffer overflow.
(cherry picked from commit 190b97e86cd07d984ea2e9f0c844d33cd3399d21)
-rw-r--r-- | regcomp.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -13323,6 +13323,18 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth) * /u. This includes the multi-char fold SHARP S to * 'ss' */ if (UNLIKELY(ender == LATIN_SMALL_LETTER_SHARP_S)) { + + /* If the node started out having uni rules, we + * wouldn't have gotten here. So this means + * something in the middle has changed it, but + * didn't think it needed to reparse. But this + * sharp s now does indicate the need for + * reparsing. */ + if (RExC_uni_semantics) { + p = oldp; + goto loopdone; + } + RExC_seen_unfolded_sharp_s = 1; maybe_exactfu = FALSE; } |