blob: d8bfba486cbecaf8a1fce9ce41df596f9ef5b9d5 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001From 3b63d12038c8d8fc278e81c942fa9bec7c704c8b Mon Sep 17 00:00:00 2001
2From: "K.Kosako" <kosako@sofnec.co.jp>
3Date: Wed, 24 May 2017 13:43:25 +0900
4Subject: [PATCH] fix #60 : invalid state(CCS_VALUE) in parse_char_class()
5
6---
7 regparse.c | 4 +++-
8 1 file changed, 3 insertions(+), 1 deletion(-)
9
10--- end of original header
11
12CVE: CVE-2017-9228
13
14Upstream-Status: Inappropriate [not author]
15Signed-off-by: Joe Slater <joe.slater@windriver.com>
16
17diff --git a/regparse.c b/regparse.c
18index 69875fa..1988747 100644
19--- a/regparse.c
20+++ b/regparse.c
21@@ -4081,7 +4081,9 @@ next_state_class(CClassNode* cc, OnigCodePoint* vs, enum CCVALTYPE* type,
22 }
23 }
24
25- *state = CCS_VALUE;
26+ if (*state != CCS_START)
27+ *state = CCS_VALUE;
28+
29 *type = CCV_CLASS;
30 return 0;
31 }
32--
331.7.9.5
34