[Pcre-svn] [1071] code/trunk: Fix overflow bug in new /u cod…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1071] code/trunk: Fix overflow bug in new /u code.
Revision: 1071
          http://www.exim.org/viewvc/pcre2?view=rev&revision=1071
Author:   ph10
Date:     2019-02-13 16:48:30 +0000 (Wed, 13 Feb 2019)
Log Message:
-----------
Fix overflow bug in new /u code. Fixes ClusterFuzz 13073.


Modified Paths:
--------------
    code/trunk/src/pcre2_compile.c
    code/trunk/testdata/testinput5
    code/trunk/testdata/testoutput5


Modified: code/trunk/src/pcre2_compile.c
===================================================================
--- code/trunk/src/pcre2_compile.c    2019-02-12 17:50:19 UTC (rev 1070)
+++ code/trunk/src/pcre2_compile.c    2019-02-13 16:48:30 UTC (rev 1071)
@@ -1596,6 +1596,7 @@
       {
       uint32_t xc;


+      if (ptr >= ptrend) break;
       if (*ptr == CHAR_LEFT_CURLY_BRACKET && 
           (extra_options & PCRE2_EXTRA_ALT_BSUX) != 0)
         {


Modified: code/trunk/testdata/testinput5
===================================================================
--- code/trunk/testdata/testinput5    2019-02-12 17:50:19 UTC (rev 1070)
+++ code/trunk/testdata/testinput5    2019-02-13 16:48:30 UTC (rev 1071)
@@ -819,6 +819,9 @@
 /^\u{0000000000010ffff}/utf,extra_alt_bsux
     \x{10ffff}


+/\u/utf,alt_bsux
+    \\u
+
 /^a+[a\x{200}]/B,utf
     aa



Modified: code/trunk/testdata/testoutput5
===================================================================
--- code/trunk/testdata/testoutput5    2019-02-12 17:50:19 UTC (rev 1070)
+++ code/trunk/testdata/testoutput5    2019-02-13 16:48:30 UTC (rev 1071)
@@ -1740,6 +1740,10 @@
     \x{10ffff}
  0: \x{10ffff}


+/\u/utf,alt_bsux
+    \\u
+ 0: u
+
 /^a+[a\x{200}]/B,utf
 ------------------------------------------------------------------
         Bra