diff --git a/ChangeLog b/ChangeLog index 118f586..70d1d79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -40,7 +40,7 @@ is NULL and the length is zero, treat as an empty string. Apparently a number of applications treat NULL/0 in this way. 14. Added support for Bidi_Class and a number of binary Unicode properties, -including Bidi_Control. +including Bidi_Control. 15. Fix some minor issues raised by clang sanitize. @@ -61,6 +61,10 @@ including Bidi_Control. (d) The standard Unicode 4-letter abbreviations for script names are now recognized. + + (e) In accordance with Unicode and Perl's "loose matching" rules, spaces, + hyphens, and underscores are ignored in property names, which are then + matched independent of case. 18. The Python scripts in the maint directory have been refactored. There are now three scripts that generate pcre2_ucd.c, pcre2_ucp.h, and pcre2_ucptables.c diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c index d42c2af..fe2bf69 100644 --- a/src/pcre2_compile.c +++ b/src/pcre2_compile.c @@ -2115,7 +2115,11 @@ if (c == CHAR_LEFT_CURLY_BRACKET) { if (ptr >= cb->end_pattern) goto ERROR_RETURN; c = *ptr++; - while (c == '_' || c == '-' || isspace(c)) c = *ptr++; + while (c == '_' || c == '-' || isspace(c)) + { + if (ptr >= cb->end_pattern) goto ERROR_RETURN; + c = *ptr++; + } if (c == CHAR_NUL) goto ERROR_RETURN; if (c == CHAR_RIGHT_CURLY_BRACKET) break; name[i] = tolower(c); diff --git a/testdata/testinput5 b/testdata/testinput5 index 4c49756..6bd352f 100644 --- a/testdata/testinput5 +++ b/testdata/testinput5 @@ -2207,5 +2207,9 @@ /\p{soft dotted}\p{sd}/g,utf >AF23<>\x{1df1a}\x{69}<>yz< + +# ------------------------------------------------ + +/\p{\2b[:xäigi:t:_/ # End of testinput5 diff --git a/testdata/testoutput5 b/testdata/testoutput5 index b52a254..2c3fe94 100644 --- a/testdata/testoutput5 +++ b/testdata/testoutput5 @@ -5010,5 +5010,10 @@ Failed: error 147 at offset 8: unknown property after \P or \p /\p{soft dotted}\p{sd}/g,utf >AF23<>\x{1df1a}\x{69}<>yz< 0: \x{1df1a}i + +# ------------------------------------------------ + +/\p{\2b[:xäigi:t:_/ +Failed: error 146 at offset 17: malformed \P or \p sequence # End of testinput5