Previout bug-fix was bad. This properly fixes an overrun while reading a

Unicode group name.
This commit is contained in:
Philip.Hazel 2019-02-07 17:59:37 +00:00
parent 45959f1eec
commit d90de8b053
6 changed files with 27 additions and 1 deletions

View File

@ -2246,8 +2246,8 @@ if (utf && is_group)
if (type != ucp_Nd && PRIV(ucp_gentype)[type] != ucp_L &&
c != CHAR_UNDERSCORE) break;
ptr++;
FORWARDCHARTEST(ptr, ptrend);
if (ptr >= ptrend) break;
FORWARDCHAR(ptr);
GETCHAR(c, ptr);
type = UCD_CHARTYPE(c);
}

View File

@ -489,4 +489,8 @@
/(?'ABZC6789012345678901234567890123'...)/utf
/(?(n/utf
/(?(á/utf
# End of testinput10

View File

@ -398,4 +398,8 @@
\x{2e80}\x{3105}\x{2e80}\x{30a1} Han Bopomofo Han Katakana
\x{d800}\x{dfff} Surrogates (Unknown) \=no_utf_check
/(?(n/utf
/(?(á/utf
# End of testinput12

View File

@ -1645,4 +1645,10 @@ Failed: error 148 at offset 36: subpattern name is too long (maximum 32 code uni
/(?'ABZC6789012345678901234567890123'...)/utf
/(?(n/utf
Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
/(?(á/utf
Failed: error 142 at offset 5: syntax error in subpattern name (missing terminator?)
# End of testinput10

View File

@ -1496,4 +1496,10 @@ Failed: error 191 at offset 0: PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is not allowe
\x{2e80}\x{3105}\x{2e80}\x{30a1} Han Bopomofo Han Katakana
\x{d800}\x{dfff} Surrogates (Unknown) \=no_utf_check
/(?(n/utf
Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
/(?(á/utf
Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
# End of testinput12

View File

@ -1494,4 +1494,10 @@ No match
\x{d800}\x{dfff} Surrogates (Unknown) \=no_utf_check
0: \x{d800}
/(?(n/utf
Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
/(?(á/utf
Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
# End of testinput12