summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libpcre/libpcre2/CVE-2022-41409.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/libpcre/libpcre2/CVE-2022-41409.patch')
-rw-r--r--meta/recipes-support/libpcre/libpcre2/CVE-2022-41409.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/meta/recipes-support/libpcre/libpcre2/CVE-2022-41409.patch b/meta/recipes-support/libpcre/libpcre2/CVE-2022-41409.patch
new file mode 100644
index 0000000000..882277ae73
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre2/CVE-2022-41409.patch
@@ -0,0 +1,74 @@
1From 94e1c001761373b7d9450768aa15d04c25547a35 Mon Sep 17 00:00:00 2001
2From: Philip Hazel <Philip.Hazel@gmail.com>
3Date: Tue, 16 Aug 2022 17:00:45 +0100
4Subject: [PATCH] Diagnose negative repeat value in pcre2test subject line
5
6CVE: CVE-2022-41409
7Upstream-Status: Backport [https://github.com/PCRE2Project/pcre2/commit/94e1c001761373b7d9450768aa15d04c25547a35]
8
9Signed-off-by: Peter Marko <peter.marko@siemens.com>
10
11---
12 ChangeLog | 3 +++
13 src/pcre2test.c | 4 ++--
14 testdata/testinput2 | 3 +++
15 testdata/testoutput2 | 4 ++++
16 4 files changed, 12 insertions(+), 2 deletions(-)
17
18diff --git a/ChangeLog b/ChangeLog
19index eab50eb7..276eb57a 100644
20--- a/ChangeLog
21+++ b/ChangeLog
22@@ -7,6 +7,9 @@ fully read in caseless matching.
23 24. Fixed an issue affecting recursions in JIT caused by duplicated data
24 transfers.
25
26+20. A negative repeat value in a pcre2test subject line was not being
27+diagnosed, leading to infinite looping.
28+
29
30 Version 10.34 21-November-2019
31 ------------------------------
32diff --git a/src/pcre2test.c b/src/pcre2test.c
33index 08f86096..f6f5d66c 100644
34--- a/src/pcre2test.c
35+++ b/src/pcre2test.c
36@@ -6700,9 +6700,9 @@ while ((c = *p++) != 0)
37 }
38
39 i = (int32_t)li;
40- if (i-- == 0)
41+ if (i-- <= 0)
42 {
43- fprintf(outfile, "** Zero repeat not allowed\n");
44+ fprintf(outfile, "** Zero or negative repeat not allowed\n");
45 return PR_OK;
46 }
47
48diff --git a/testdata/testinput2 b/testdata/testinput2
49index 655e519..14e00ed 100644
50--- a/testdata/testinput2
51+++ b/testdata/testinput2
52@@ -5772,4 +5772,7 @@ a)"xI
53 /(a)?a/I
54 manm
55
56+--
57+ \[X]{-10}
58+
59 # End of testinput2
60diff --git a/testdata/testoutput2 b/testdata/testoutput2
61index c733c12..958f246 100644
62--- a/testdata/testoutput2
63+++ b/testdata/testoutput2
64@@ -17435,6 +17435,10 @@ Subject length lower bound = 1
65 manm
66 0: a
67
68+--
69+ \[X]{-10}
70+** Zero or negative repeat not allowed
71+
72 # End of testinput2
73 Error -70: PCRE2_ERROR_BADDATA (unknown error number)
74 Error -62: bad serialized data