[Pcre-svn] [1069] code/trunk: Previout bug-fix was bad.

Páxina inicial
Borrar esta mensaxe
Autor: Subversion repository
Data:  
Para: pcre-svn
Asunto: [Pcre-svn] [1069] code/trunk: Previout bug-fix was bad.
Revision: 1069
          http://www.exim.org/viewvc/pcre2?view=rev&revision=1069
Author:   ph10
Date:     2019-02-07 17:59:37 +0000 (Thu, 07 Feb 2019)
Log Message:
-----------
Previout bug-fix was bad. This properly fixes an overrun while reading a 
Unicode group name.


Modified Paths:
--------------
    code/trunk/src/pcre2_compile.c
    code/trunk/testdata/testinput10
    code/trunk/testdata/testinput12
    code/trunk/testdata/testoutput10
    code/trunk/testdata/testoutput12-16
    code/trunk/testdata/testoutput12-32


Modified: code/trunk/src/pcre2_compile.c
===================================================================
--- code/trunk/src/pcre2_compile.c    2019-02-07 17:29:50 UTC (rev 1068)
+++ code/trunk/src/pcre2_compile.c    2019-02-07 17:59:37 UTC (rev 1069)
@@ -2246,8 +2246,8 @@
     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);
     }


Modified: code/trunk/testdata/testinput10
===================================================================
--- code/trunk/testdata/testinput10    2019-02-07 17:29:50 UTC (rev 1068)
+++ code/trunk/testdata/testinput10    2019-02-07 17:59:37 UTC (rev 1069)
@@ -489,4 +489,8 @@


/(?'ABZC6789012345678901234567890123'...)/utf

+/(?(n/utf
+
+/(?(á/utf
+
# End of testinput10

Modified: code/trunk/testdata/testinput12
===================================================================
--- code/trunk/testdata/testinput12    2019-02-07 17:29:50 UTC (rev 1068)
+++ code/trunk/testdata/testinput12    2019-02-07 17:59:37 UTC (rev 1069)
@@ -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

Modified: code/trunk/testdata/testoutput10
===================================================================
--- code/trunk/testdata/testoutput10    2019-02-07 17:29:50 UTC (rev 1068)
+++ code/trunk/testdata/testoutput10    2019-02-07 17:59:37 UTC (rev 1069)
@@ -1645,4 +1645,10 @@


/(?'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

Modified: code/trunk/testdata/testoutput12-16
===================================================================
--- code/trunk/testdata/testoutput12-16    2019-02-07 17:29:50 UTC (rev 1068)
+++ code/trunk/testdata/testoutput12-16    2019-02-07 17:59:37 UTC (rev 1069)
@@ -1496,4 +1496,10 @@
     \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

Modified: code/trunk/testdata/testoutput12-32
===================================================================
--- code/trunk/testdata/testoutput12-32    2019-02-07 17:29:50 UTC (rev 1068)
+++ code/trunk/testdata/testoutput12-32    2019-02-07 17:59:37 UTC (rev 1069)
@@ -1494,4 +1494,10 @@
     \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