Fix PCRE2_NO_AUTO_CAPTURE bug.
This commit is contained in:
parent
8a8d0ced69
commit
766fbc81d0
|
@ -213,6 +213,10 @@ and AddressSanitizer.
|
|||
61. Whitespace at the end of a pcre2test pattern line caused a spurious error
|
||||
message if there were only single-character modifiers. It should be ignored.
|
||||
|
||||
62. The use of PCRE2_NO_AUTO_CAPTURE could cause incorrect compilation results
|
||||
or segmentation errors for some patterns. Found with libFuzzer and
|
||||
AddressSanitizer.
|
||||
|
||||
|
||||
Version 10.20 30-June-2015
|
||||
--------------------------
|
||||
|
|
|
@ -3187,9 +3187,10 @@ for (; ptr < cb->end_pattern; ptr++)
|
|||
|
||||
if (ptr[1] != CHAR_QUESTION_MARK)
|
||||
{
|
||||
if (ptr[1] != CHAR_ASTERISK &&
|
||||
(options & PCRE2_NO_AUTO_CAPTURE) == 0)
|
||||
cb->bracount++; /* Capturing group */
|
||||
if (ptr[1] != CHAR_ASTERISK)
|
||||
{
|
||||
if ((options & PCRE2_NO_AUTO_CAPTURE) == 0) cb->bracount++;
|
||||
}
|
||||
else /* (*something) - just skip to closing ket */
|
||||
{
|
||||
ptr += 2;
|
||||
|
|
|
@ -4583,4 +4583,8 @@ B)x/alt_verbnames,mark
|
|||
|
||||
/^(o(\1{72}{\"{\\{00000059079}\d*){74}}){19}/I
|
||||
|
||||
/((p(?'K/
|
||||
|
||||
/((p(?'K/no_auto_capture
|
||||
|
||||
# End of testinput2
|
||||
|
|
|
@ -14668,4 +14668,10 @@ Overall options: anchored
|
|||
Last code unit = '}'
|
||||
Subject length lower bound = 65535
|
||||
|
||||
/((p(?'K/
|
||||
Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator)
|
||||
|
||||
/((p(?'K/no_auto_capture
|
||||
Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator)
|
||||
|
||||
# End of testinput2
|
||||
|
|
Loading…
Reference in New Issue