[Pcre-svn] [1102] code/trunk: Fix minor oversight in previou…

Páxina inicial
Borrar esta mensaxe
Autor: Subversion repository
Data:  
Para: pcre-svn
Asunto: [Pcre-svn] [1102] code/trunk: Fix minor oversight in previous patch.
Revision: 1102
          http://www.exim.org/viewvc/pcre2?view=rev&revision=1102
Author:   ph10
Date:     2019-06-11 08:37:29 +0100 (Tue, 11 Jun 2019)
Log Message:
-----------
Fix minor oversight in previous patch. Fixes clusterfuzz 15199.


Modified Paths:
--------------
    code/trunk/src/pcre2_compile.c
    code/trunk/testdata/testinput2
    code/trunk/testdata/testoutput2


Modified: code/trunk/src/pcre2_compile.c
===================================================================
--- code/trunk/src/pcre2_compile.c    2019-06-10 16:41:22 UTC (rev 1101)
+++ code/trunk/src/pcre2_compile.c    2019-06-11 07:37:29 UTC (rev 1102)
@@ -2448,7 +2448,7 @@
 enum { RANGE_NO, RANGE_STARTED, RANGE_OK_ESCAPED, RANGE_OK_LITERAL };


/* Only in 32-bit mode can there be literals > META_END. A macro encapsulates
-the storing of literal values in the main parsed pattern, where they can always
+the storing of literal values in the main parsed pattern, where they can always
be quantified. */

 #if PCRE2_CODE_UNIT_WIDTH == 32
@@ -2642,10 +2642,10 @@
       default:                     /* Don't use PARSED_LITERAL() because it */
 #if PCRE2_CODE_UNIT_WIDTH == 32    /* sets okquantifier. */
       if (c >= META_END) *parsed_pattern++ = META_BIGVALUE;
-#endif       
+#endif
       *parsed_pattern++ = c;
       break;
-      
+
       case CHAR_RIGHT_PARENTHESIS:
       inverbname = FALSE;
       /* This is the length in characters */
@@ -2681,8 +2681,11 @@


       switch(escape)
         {
-        case 0:
-        PARSED_LITERAL(c, parsed_pattern);
+        case 0:                    /* Don't use PARSED_LITERAL() because it */
+#if PCRE2_CODE_UNIT_WIDTH == 32    /* sets okquantifier. */
+        if (c >= META_END) *parsed_pattern++ = META_BIGVALUE;
+#endif
+        *parsed_pattern++ = c;
         break;


         case ESC_Q:
@@ -3793,7 +3796,7 @@


         /* Remember where this verb, possibly with a preceding (*MARK), starts,
         for handling quantified (*ACCEPT). */
-        
+
         verbstartptr = parsed_pattern;
         okquantifier = (verbs[i].meta == META_ACCEPT);



Modified: code/trunk/testdata/testinput2
===================================================================
--- code/trunk/testdata/testinput2    2019-06-10 16:41:22 UTC (rev 1101)
+++ code/trunk/testdata/testinput2    2019-06-11 07:37:29 UTC (rev 1102)
@@ -5603,4 +5603,6 @@
     abc
     axy


+/(*:\)?/
+
# End of testinput2

Modified: code/trunk/testdata/testoutput2
===================================================================
--- code/trunk/testdata/testoutput2    2019-06-10 16:41:22 UTC (rev 1101)
+++ code/trunk/testdata/testoutput2    2019-06-11 07:37:29 UTC (rev 1102)
@@ -16959,6 +16959,9 @@
  0: a
 MK: XX


+/(*:\)?/
+Failed: error 109 at offset 5: quantifier does not follow a repeatable item
+
# End of testinput2
Error -70: PCRE2_ERROR_BADDATA (unknown error number)
Error -62: bad serialized data