Fix a pcre2test crash on multiple push statements
This commit is contained in:
parent
bf70a0d2a4
commit
adc9e95e1d
@ -0,0 +1,255 @@
|
||||
From fcc05a01a8c1f87b3286a27dffc508dd5b0ced31 Mon Sep 17 00:00:00 2001
|
||||
From: ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>
|
||||
Date: Sat, 6 May 2017 16:56:07 +0000
|
||||
Subject: [PATCH] Fix crash when more than one kind of "push" was set in
|
||||
pcre2test.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@767 6239d852-aaf2-0410-a92c-79f79f948069
|
||||
|
||||
Petr Písař: Ported to 10.23.
|
||||
---
|
||||
src/pcre2test.c | 15 +++++++++------
|
||||
testdata/testinput20 | 44 ++++++++++++++++++++++++++------------------
|
||||
testdata/testoutput20 | 47 +++++++++++++++++++++++++++++------------------
|
||||
|
||||
diff --git a/src/pcre2test.c b/src/pcre2test.c
|
||||
index a7fe7c0..cab604f 100644
|
||||
--- a/src/pcre2test.c
|
||||
+++ b/src/pcre2test.c
|
||||
@@ -721,12 +721,15 @@ the first control word. Note that CTL_POSIX_NOSUB is always accompanied by
|
||||
CTL_POSIX, so it doesn't need its own entries. */
|
||||
|
||||
static uint32_t exclusive_pat_controls[] = {
|
||||
- CTL_POSIX | CTL_HEXPAT,
|
||||
- CTL_POSIX | CTL_PUSH,
|
||||
- CTL_POSIX | CTL_PUSHCOPY,
|
||||
- CTL_POSIX | CTL_PUSHTABLESCOPY,
|
||||
- CTL_POSIX | CTL_USE_LENGTH,
|
||||
- CTL_EXPAND | CTL_HEXPAT };
|
||||
+ CTL_POSIX | CTL_HEXPAT,
|
||||
+ CTL_POSIX | CTL_PUSH,
|
||||
+ CTL_POSIX | CTL_PUSHCOPY,
|
||||
+ CTL_POSIX | CTL_PUSHTABLESCOPY,
|
||||
+ CTL_POSIX | CTL_USE_LENGTH,
|
||||
+ CTL_PUSH | CTL_PUSHCOPY,
|
||||
+ CTL_PUSH | CTL_PUSHTABLESCOPY,
|
||||
+ CTL_PUSHCOPY | CTL_PUSHTABLESCOPY,
|
||||
+ CTL_EXPAND | CTL_HEXPAT };
|
||||
|
||||
/* Data controls that are mutually exclusive. At present these are all in the
|
||||
first control word. */
|
||||
diff --git a/testdata/testinput20 b/testdata/testinput20
|
||||
index c87a07e..71f39ae 100644
|
||||
--- a/testdata/testinput20
|
||||
+++ b/testdata/testinput20
|
||||
@@ -31,20 +31,20 @@
|
||||
#load testsaved2
|
||||
|
||||
#pop info
|
||||
- foofoo
|
||||
+ foofoo
|
||||
barbar
|
||||
-
|
||||
+
|
||||
#pop mark
|
||||
C
|
||||
-\= Expect no match
|
||||
- D
|
||||
-
|
||||
+\= Expect no match
|
||||
+ D
|
||||
+
|
||||
#pop
|
||||
- AmanaplanacanalPanama
|
||||
+ AmanaplanacanalPanama
|
||||
|
||||
#pop info
|
||||
metcalfe 33
|
||||
-
|
||||
+
|
||||
# Check for an error when different tables are used.
|
||||
|
||||
/abc/push,tables=1
|
||||
@@ -59,30 +59,30 @@
|
||||
|
||||
#pop should give an error
|
||||
pqr
|
||||
-
|
||||
+
|
||||
/abcd/pushcopy
|
||||
abcd
|
||||
-
|
||||
+
|
||||
#pop
|
||||
- abcd
|
||||
+ abcd
|
||||
|
||||
#pop should give an error
|
||||
|
||||
/abcd/push
|
||||
#popcopy
|
||||
abcd
|
||||
-
|
||||
+
|
||||
#pop
|
||||
- abcd
|
||||
-
|
||||
+ abcd
|
||||
+
|
||||
/abcd/push
|
||||
#save testsaved1
|
||||
#pop should give an error
|
||||
|
||||
#load testsaved1
|
||||
-#popcopy
|
||||
+#popcopy
|
||||
abcd
|
||||
-
|
||||
+
|
||||
#pop
|
||||
abcd
|
||||
|
||||
@@ -91,10 +91,18 @@
|
||||
/abcd/pushtablescopy
|
||||
abcd
|
||||
|
||||
-#popcopy
|
||||
+#popcopy
|
||||
abcd
|
||||
-
|
||||
+
|
||||
#pop
|
||||
- abcd
|
||||
+ abcd
|
||||
+
|
||||
+# Must only specify one of these
|
||||
+
|
||||
+//push,pushcopy
|
||||
+
|
||||
+//push,pushtablescopy
|
||||
+
|
||||
+//pushcopy,pushtablescopy
|
||||
|
||||
# End of testinput20
|
||||
diff --git a/testdata/testoutput20 b/testdata/testoutput20
|
||||
index db99866..d6265fd 100644
|
||||
--- a/testdata/testoutput20
|
||||
+++ b/testdata/testoutput20
|
||||
@@ -40,25 +40,25 @@ Named capturing subpatterns:
|
||||
Options: dupnames
|
||||
Starting code units: b f
|
||||
Subject length lower bound = 6
|
||||
- foofoo
|
||||
+ foofoo
|
||||
0: foofoo
|
||||
1: foo
|
||||
barbar
|
||||
0: barbar
|
||||
1: <unset>
|
||||
2: bar
|
||||
-
|
||||
+
|
||||
#pop mark
|
||||
C
|
||||
0: C
|
||||
1: C
|
||||
MK: A
|
||||
-\= Expect no match
|
||||
- D
|
||||
+\= Expect no match
|
||||
+ D
|
||||
No match, mark = A
|
||||
-
|
||||
+
|
||||
#pop
|
||||
- AmanaplanacanalPanama
|
||||
+ AmanaplanacanalPanama
|
||||
0: AmanaplanacanalPanama
|
||||
1: <unset>
|
||||
2: <unset>
|
||||
@@ -78,7 +78,7 @@ Subject length lower bound = 3
|
||||
0: metcalfe 33
|
||||
1: metcalfe
|
||||
2: 33
|
||||
-
|
||||
+
|
||||
# Check for an error when different tables are used.
|
||||
|
||||
/abc/push,tables=1
|
||||
@@ -97,13 +97,13 @@ Serialization failed: error -30: patterns do not all use the same character tabl
|
||||
#pop should give an error
|
||||
** Can't pop off an empty stack
|
||||
pqr
|
||||
-
|
||||
+
|
||||
/abcd/pushcopy
|
||||
abcd
|
||||
0: abcd
|
||||
-
|
||||
+
|
||||
#pop
|
||||
- abcd
|
||||
+ abcd
|
||||
0: abcd
|
||||
|
||||
#pop should give an error
|
||||
@@ -113,21 +113,21 @@ Serialization failed: error -30: patterns do not all use the same character tabl
|
||||
#popcopy
|
||||
abcd
|
||||
0: abcd
|
||||
-
|
||||
+
|
||||
#pop
|
||||
- abcd
|
||||
+ abcd
|
||||
0: abcd
|
||||
-
|
||||
+
|
||||
/abcd/push
|
||||
#save testsaved1
|
||||
#pop should give an error
|
||||
** Can't pop off an empty stack
|
||||
|
||||
#load testsaved1
|
||||
-#popcopy
|
||||
+#popcopy
|
||||
abcd
|
||||
0: abcd
|
||||
-
|
||||
+
|
||||
#pop
|
||||
abcd
|
||||
0: abcd
|
||||
@@ -139,12 +139,23 @@ Serialization failed: error -30: patterns do not all use the same character tabl
|
||||
abcd
|
||||
0: abcd
|
||||
|
||||
-#popcopy
|
||||
+#popcopy
|
||||
abcd
|
||||
0: abcd
|
||||
-
|
||||
+
|
||||
#pop
|
||||
- abcd
|
||||
+ abcd
|
||||
0: abcd
|
||||
|
||||
+# Must only specify one of these
|
||||
+
|
||||
+//push,pushcopy
|
||||
+** Not allowed together: push pushcopy
|
||||
+
|
||||
+//push,pushtablescopy
|
||||
+** Not allowed together: push pushtablescopy
|
||||
+
|
||||
+//pushcopy,pushtablescopy
|
||||
+** Not allowed together: pushcopy pushtablescopy
|
||||
+
|
||||
# End of testinput20
|
||||
--
|
||||
2.9.3
|
||||
|
@ -2,7 +2,7 @@
|
||||
#%%global rcversion RC1
|
||||
Name: pcre2
|
||||
Version: 10.23
|
||||
Release: %{?rcversion:0.}6%{?rcversion:.%rcversion}%{?dist}
|
||||
Release: %{?rcversion:0.}7%{?rcversion:.%rcversion}%{?dist}
|
||||
%global myversion %{version}%{?rcversion:-%rcversion}
|
||||
Summary: Perl-compatible regular expression library
|
||||
Group: System Environment/Libraries
|
||||
@ -78,6 +78,9 @@ Patch12: pcre2-10.23-Fix-character-type-detection-when-32-bit-and-UCP-are.pat
|
||||
# Fix an incorrect cast in UTF validation, upstream bug #2090,
|
||||
# in upstream after 10.23
|
||||
Patch13: pcre2-10.23-Correct-an-incorrect-cast.patch
|
||||
# Fix a pcre2test crash on multiple push statements, upstream bug #2109,
|
||||
# in upstream after 10.23
|
||||
Patch14: pcre2-10.23-Fix-crash-when-more-than-one-kind-of-push-was-set-in.patch
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: coreutils
|
||||
@ -167,6 +170,7 @@ Utilities demonstrating PCRE2 capabilities like pcre2grep or pcre2test.
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
# Because of multilib patch
|
||||
libtoolize --copy --force
|
||||
autoreconf -vif
|
||||
@ -265,6 +269,9 @@ make %{?_smp_mflags} check VERBOSE=yes
|
||||
%{_mandir}/man1/pcre2test.*
|
||||
|
||||
%changelog
|
||||
* Tue May 09 2017 Petr Pisar <ppisar@redhat.com> - 10.23-7
|
||||
- Fix a pcre2test crash on multiple push statements (upstream bug #2109)
|
||||
|
||||
* Tue Apr 18 2017 Petr Pisar <ppisar@redhat.com> - 10.23-6
|
||||
- Fix CVE-2017-7186 in JIT mode (a crash when finding a Unicode property for
|
||||
a character with a code point greater than 0x10ffff in UTF-32 library while
|
||||
|
Loading…
Reference in New Issue
Block a user