[Pcre-svn] [1105] code/trunk: Another fix to the recent (*AC…

Páxina inicial
Borrar esta mensaxe
Autor: Subversion repository
Data:  
Para: pcre-svn
Asunto: [Pcre-svn] [1105] code/trunk: Another fix to the recent (*ACCEPT) patch.
Revision: 1105
          http://www.exim.org/viewvc/pcre2?view=rev&revision=1105
Author:   ph10
Date:     2019-06-14 16:44:57 +0100 (Fri, 14 Jun 2019)
Log Message:
-----------
Another fix to the recent (*ACCEPT) patch. Fixes clusterfuzz 15242.


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-13 16:49:40 UTC (rev 1104)
+++ code/trunk/src/pcre2_compile.c    2019-06-14 15:44:57 UTC (rev 1105)
@@ -2599,10 +2599,20 @@
         errorcode = ERR28;
         goto FAILED;
         }
-      if (!inverbname && after_manual_callout-- <= 0)
-        parsed_pattern = manage_callouts(thisptr, &previous_callout,
-          auto_callout, parsed_pattern, cb);
-      PARSED_LITERAL(c, parsed_pattern);
+      if (inverbname)
+        {                          /* 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;
+        }
+      else
+        {
+        if (after_manual_callout-- <= 0)
+          parsed_pattern = manage_callouts(thisptr, &previous_callout,
+            auto_callout, parsed_pattern, cb);
+        PARSED_LITERAL(c, parsed_pattern);
+        }
       meta_quantifier = 0;
       }
     continue;  /* Next character */


Modified: code/trunk/testdata/testinput2
===================================================================
--- code/trunk/testdata/testinput2    2019-06-13 16:49:40 UTC (rev 1104)
+++ code/trunk/testdata/testinput2    2019-06-14 15:44:57 UTC (rev 1105)
@@ -5605,4 +5605,6 @@


/(*:\)?/

+/(*:\Q \E){5}/alt_verbnames
+
# End of testinput2

Modified: code/trunk/testdata/testoutput2
===================================================================
--- code/trunk/testdata/testoutput2    2019-06-13 16:49:40 UTC (rev 1104)
+++ code/trunk/testdata/testoutput2    2019-06-14 15:44:57 UTC (rev 1105)
@@ -16960,6 +16960,9 @@
 /(*:\)?/
 Failed: error 109 at offset 5: quantifier does not follow a repeatable item


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