summaryrefslogtreecommitdiff
path: root/system/pcre2/CVE-2019-20454.patch
blob: bdec87294f43ca005cab7907937a07c76d957b6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Revision: 1091
Author: ph10
Date: Mon May 13 16:26:17 2019 UTC
URL: https://vcs.pcre.org/pcre2?view=revision&revision=1091

Fix crash when \X is used without UTF in JIT.

--- a/testdata/testinput4	2019/05/11 11:43:39	1090
+++ b/testdata/testinput4	2019/05/13 16:26:17	1091
@@ -2480,4 +2480,7 @@
 /^(?'אABC'...)(?&אABC)/utf
     123123123456
 
+/\X*/
+    \xF3aaa\xE4\xEA\xEB\xFEa
+
 # End of testinput4
--- a/testdata/testoutput4	2019/05/11 11:43:39	1090
+++ b/testdata/testoutput4	2019/05/13 16:26:17	1091
@@ -4012,4 +4012,8 @@
  0: 123123
  1: 123
 
+/\X*/
+    \xF3aaa\xE4\xEA\xEB\xFEa
+ 0: \xf3aaa\xe4\xea\xeb\xfea
+
 # End of testinput4

Revision: 1092
Author: ph10
Date: Mon May 13 16:38:18 2019 UTC
URL: https://vcs.pcre.org/pcre2?view=revision&revision=1092

Forgot this file in previous commit. Fixes JIT non-UTF bug.

--- a/src/pcre2_jit_compile.c	2019/05/13 16:26:17	1091
+++ b/src/pcre2_jit_compile.c	2019/05/13 16:38:18	1092
@@ -8571,7 +8571,10 @@
 PCRE2_SPTR bptr;
 uint32_t c;
 
-GETCHARINC(c, cc);
+/* Patch by PH */
+/* GETCHARINC(c, cc); */
+
+c = *cc++;
 #if PCRE2_CODE_UNIT_WIDTH == 32
 if (c >= 0x110000)
   return NULL;