Fix mismatching characters in the range 128-255 against [:punct:] in UCP mode

This commit is contained in:
Petr Písař 2015-11-18 12:44:28 +01:00
parent 852fc765de
commit 3e481a6e9b
3 changed files with 100 additions and 0 deletions

View File

@ -0,0 +1,60 @@
From 9660a9ee23143928ed55e00a8081f93c67613305 Mon Sep 17 00:00:00 2001
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
Date: Tue, 17 Nov 2015 17:53:37 +0000
Subject: [PATCH] Fix [:punct:] bug in UCP mode (interpreter only).
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1605 2f5784b3-3f2a-0410-8824-cb99058d5e15
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
pcre_xclass.c | 2 +-
testdata/testinput6 | 4 ++++
testdata/testoutput6 | 6 ++++++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/pcre_xclass.c b/pcre_xclass.c
index c2b61f0..ef759a5 100644
--- a/pcre_xclass.c
+++ b/pcre_xclass.c
@@ -246,7 +246,7 @@ while ((t = *data++) != XCL_END)
case PT_PXPUNCT:
if ((PRIV(ucp_gentype)[prop->chartype] == ucp_P ||
- (c < 256 && PRIV(ucp_gentype)[prop->chartype] == ucp_S)) == isprop)
+ (c < 128 && PRIV(ucp_gentype)[prop->chartype] == ucp_S)) == isprop)
return !negated;
break;
diff --git a/testdata/testinput6 b/testdata/testinput6
index 5666fbc..8aee0d0 100644
--- a/testdata/testinput6
+++ b/testdata/testinput6
@@ -1505,4 +1505,8 @@
/[\pS#moq]/
=
+/[[:punct:]]/8W
+ \xc2\xb4
+ \x{b4}
+
/-- End of testinput6 --/
diff --git a/testdata/testoutput6 b/testdata/testoutput6
index 72e4f46..196f993 100644
--- a/testdata/testoutput6
+++ b/testdata/testoutput6
@@ -2473,4 +2473,10 @@ No match
=
0: =
+/[[:punct:]]/8W
+ \xc2\xb4
+No match
+ \x{b4}
+No match
+
/-- End of testinput6 --/
--
2.4.3

View File

@ -0,0 +1,30 @@
From 0358b7127db0d2ad71cfc27be34cb5fdd5e9a76a Mon Sep 17 00:00:00 2001
From: zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>
Date: Wed, 18 Nov 2015 07:54:08 +0000
Subject: [PATCH] Hotfix for [:punct:] in JIT.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1607 2f5784b3-3f2a-0410-8824-cb99058d5e15
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
pcre_jit_compile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pcre_jit_compile.c b/pcre_jit_compile.c
index f85912d..445de0c 100644
--- a/pcre_jit_compile.c
+++ b/pcre_jit_compile.c
@@ -5256,7 +5256,7 @@ while (*cc != XCL_END)
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_LESS_EQUAL);
SET_CHAR_OFFSET(0);
- OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xff);
+ OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x7f);
OP_FLAGS(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_LESS_EQUAL);
SET_TYPE_OFFSET(ucp_Pc);
--
2.4.3

View File

@ -38,6 +38,12 @@ Patch2: pcre-8.38-RC1-Fix-crash-caused-by-long-MARK-or-THEN-names.patch
# in a class item while UCP mode is active, upstream bug #1717,
# in upstream after 8.38-RC1
Patch3: pcre-8.38-RC1-Fix-POSIX-class-single-character-bug.patch
# Fix mismatching characters in the range 128-255 against [:punct:] in UCP
# mode, interpreted code, upstream bug #1718, in upstream after 8.38-RC1
Patch4: pcre-8.38-RC1-Fix-punct-bug-in-UCP-mode-interpreter-only.patch
# Fix mismatching characters in the range 128-255 against [:punct:] in UCP
# mode, JITted code, upstream bug #1718, in upstream after 8.38-RC1
Patch5: pcre-8.38-RC1-Hotfix-for-punct-in-JIT.patch
BuildRequires: readline-devel
BuildRequires: autoconf
BuildRequires: automake
@ -90,6 +96,8 @@ Utilities demonstrating PCRE capabilities like pcregrep or pcretest.
%patch1 -p1 -b .terminated_typos
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
# Because of rpath patch
libtoolize --copy --force
autoreconf -vif
@ -165,6 +173,8 @@ make %{?_smp_mflags} check VERBOSE=yes
- Fix crash when compiling an expression with long (*MARK) or (*THEN) names
- Fix compiling a POSIX character class followed by a single ASCII character
in a class item while UCP mode is active (upstream bug #1717)
- Fix mismatching characters in the range 128-255 against [:punct:] in UCP
mode (upstream bug #1718)
* Thu Oct 29 2015 Petr Pisar <ppisar@redhat.com> - 8.38-0.1.RC1
- 8.38-RC1 bump