summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libpcre/libpcre2/CVE-2022-1586-regression.patch
blob: 42ee417fe7a9302008faecb27ef76a6d54bf4d3e (plain)
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
From 5d1e62b0155292b994aa1c96d4ed8ce4346ef4c2 Mon Sep 17 00:00:00 2001
From: Zoltan Herczeg <hzmester@freemail.hu>
Date: Thu, 24 Mar 2022 05:34:42 +0000
Subject: [PATCH] Fix incorrect value reading in JIT.

CVE: CVE-2022-1586
Upstream-Status: Backport [https://github.com/PCRE2Project/pcre2/commit/d4fa336fbcc3]

(cherry picked from commit d4fa336fbcc388f89095b184ba6d99422cfc676c)
Signed-off-by: Shinu Chandran <shinucha@cisco.com>
---
 src/pcre2_jit_compile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c
index 493c96d..fa57942 100644
--- a/src/pcre2_jit_compile.c
+++ b/src/pcre2_jit_compile.c
@@ -7188,7 +7188,7 @@ while (*cc != XCL_END)
     {
     SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
     cc++;
-    if (*cc == PT_CLIST && *cc == XCL_PROP)
+    if (*cc == PT_CLIST && cc[-1] == XCL_PROP)
       {
       other_cases = PRIV(ucd_caseless_sets) + cc[1];
       while (*other_cases != NOTACHAR)
-- 
2.25.1