diff options
author | Karl Williamson <khw@cpan.org> | 2018-03-24 10:38:59 -0600 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2018-03-24 17:09:39 +0000 |
commit | d7f1769e22923295a36dc62fed961aa272f7a4ca (patch) | |
tree | 50b20e1025d1ec869853a94e8bbfaf092067ae6c | |
parent | 70858a4fde4798f312b4c6d2cbae604a978aaf24 (diff) | |
download | perl-d7f1769e22923295a36dc62fed961aa272f7a4ca.tar.gz |
PATCH: [perl #132055] Assertion failure
This checks for and aborts if it find control characters in a supposed
Unicode property name. Code further along could not handle these.
This also fixes #132553 and #132658
-rw-r--r-- | regcomp.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -15925,6 +15925,8 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, case 'P': { char *e; + char *i; + /* We will handle any undefined properties ourselves */ U8 swash_init_flags = _CORE_SWASH_INIT_RETURN_IF_UNDEF @@ -15968,6 +15970,14 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, n = e - RExC_parse; while (isSPACE(*(RExC_parse + n - 1))) n--; + + for (i = RExC_parse; i < RExC_parse + n; i++) { + if (isCNTRL(*i) && *i != '\t') { + char * name = Perl_form(aTHX_ "%.*s", (int)n, RExC_parse); + RExC_parse = e + 1; + vFAIL2("Can't find Unicode property definition \"%s\"", name); + } + } } /* The \p isn't immediately followed by a '{' */ else if (! isALPHA(*RExC_parse)) { RExC_parse += (UTF) ? UTF8SKIP(RExC_parse) : 1; |