basebuilder_pel7x64builder0
5 years ago
5 changed files with 482 additions and 36 deletions
@ -0,0 +1,53 @@
@@ -0,0 +1,53 @@
|
||||
From dd9e5dc97b897fdec64525560131c1ffb8d8a4d4 Mon Sep 17 00:00:00 2001 |
||||
From: zherczeg <zherczeg@6239d852-aaf2-0410-a92c-79f79f948069> |
||||
Date: Fri, 21 Sep 2018 07:24:34 +0000 |
||||
Subject: [PATCH] Fix an xclass matching issue in JIT. |
||||
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@1016 6239d852-aaf2-0410-a92c-79f79f948069 |
||||
Petr Písař: Ported to 10.32. |
||||
--- |
||||
src/pcre2_jit_compile.c | 6 +++--- |
||||
src/pcre2_jit_test.c | 1 + |
||||
|
||||
diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c |
||||
index 2c49f1c..4e69e76 100644 |
||||
--- a/src/pcre2_jit_compile.c |
||||
+++ b/src/pcre2_jit_compile.c |
||||
@@ -7012,9 +7012,6 @@ int i, j, k, len, c; |
||||
if (!sljit_has_cpu_feature(SLJIT_HAS_CMOV)) |
||||
return FALSE; |
||||
|
||||
-if (invert) |
||||
- nclass = !nclass; |
||||
- |
||||
len = 0; |
||||
|
||||
for (i = 0; i < 32; i++) |
||||
@@ -7096,6 +7093,9 @@ if (j != 0) |
||||
} |
||||
} |
||||
|
||||
+if (invert) |
||||
+ nclass = !nclass; |
||||
+ |
||||
type = nclass ? SLJIT_NOT_EQUAL : SLJIT_EQUAL; |
||||
add_jump(compiler, backtracks, CMP(type, TMP2, 0, SLJIT_IMM, 0)); |
||||
return TRUE; |
||||
diff --git a/src/pcre2_jit_test.c b/src/pcre2_jit_test.c |
||||
index d5f4a96..10c064e 100644 |
||||
--- a/src/pcre2_jit_test.c |
||||
+++ b/src/pcre2_jit_test.c |
||||
@@ -383,6 +383,7 @@ static struct regression_test_case regression_test_cases[] = { |
||||
{ MU, A, 0, 0, "[^\\x{801}-\\x{fffe}]+", "\xe0\xa0\x81#\xc3\xa9\xf0\x90\x90\x80\xe0\xa0\x80\xef\xbf\xbf\xef\xbf\xbe" }, |
||||
{ MU, A, 0, 0, "[\\x{10001}-\\x{10fffe}]+", "#\xc3\xa9\xe2\xb1\xa5\xf0\x90\x80\x80\xf0\x90\x80\x81\xf4\x8f\xbf\xbe\xf4\x8f\xbf\xbf" }, |
||||
{ MU, A, 0, 0, "[^\\x{10001}-\\x{10fffe}]+", "\xf0\x90\x80\x81#\xc3\xa9\xe2\xb1\xa5\xf0\x90\x80\x80\xf4\x8f\xbf\xbf\xf4\x8f\xbf\xbe" }, |
||||
+ { CMU, A, 0, 0 | F_NOMATCH, "^[\\x{0100}-\\x{017f}]", " " }, |
||||
|
||||
/* Unicode properties. */ |
||||
{ MUP, A, 0, 0, "[1-5\xc3\xa9\\w]", "\xc3\xa1_" }, |
||||
-- |
||||
2.17.1 |
||||
|
@ -0,0 +1,67 @@
@@ -0,0 +1,67 @@
|
||||
From 18ee5a9d3779f5e8ee3142326dd65ae75b22bb0b Mon Sep 17 00:00:00 2001 |
||||
From: ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> |
||||
Date: Mon, 22 Oct 2018 16:47:55 +0000 |
||||
Subject: [PATCH] Fix heap limit checking overflow bug in pcre2_dfa_match(). |
||||
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@1034 6239d852-aaf2-0410-a92c-79f79f948069 |
||||
|
||||
Petr Písař: Ported to 10.32. |
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com> |
||||
--- |
||||
src/pcre2_dfa_match.c | 22 +++++++++++++--------- |
||||
1 file changed, 13 insertions(+), 9 deletions(-) |
||||
|
||||
diff --git a/src/pcre2_dfa_match.c b/src/pcre2_dfa_match.c |
||||
index 9b43237..818004d 100644 |
||||
--- a/src/pcre2_dfa_match.c |
||||
+++ b/src/pcre2_dfa_match.c |
||||
@@ -316,8 +316,8 @@ finding the minimum heap requirement for a match. */ |
||||
|
||||
typedef struct RWS_anchor { |
||||
struct RWS_anchor *next; |
||||
- unsigned int size; /* Number of ints */ |
||||
- unsigned int free; /* Number of ints */ |
||||
+ uint32_t size; /* Number of ints */ |
||||
+ uint32_t free; /* Number of ints */ |
||||
} RWS_anchor; |
||||
|
||||
#define RWS_ANCHOR_SIZE (sizeof(RWS_anchor)/sizeof(int)) |
||||
@@ -413,20 +413,24 @@ if (rws->next != NULL) |
||||
new = rws->next; |
||||
} |
||||
|
||||
-/* All sizes are in units of sizeof(int), except for mb->heaplimit, which is in |
||||
-kibibytes. */ |
||||
+/* Sizes in the RWS_anchor blocks are in units of sizeof(int), but |
||||
+mb->heap_limit and mb->heap_used are in kibibytes. Play carefully, to avoid |
||||
+overflow. */ |
||||
|
||||
else |
||||
{ |
||||
- unsigned int newsize = rws->size * 2; |
||||
- unsigned int heapleft = (unsigned int) |
||||
- (((1024/sizeof(int))*mb->heap_limit - mb->heap_used)); |
||||
- if (newsize > heapleft) newsize = heapleft; |
||||
+ uint32_t newsize = (rws->size >= UINT32_MAX/2)? UINT32_MAX/2 : rws->size * 2; |
||||
+ uint32_t newsizeK = newsize/(1024/sizeof(int)); |
||||
+ |
||||
+ if (newsizeK + mb->heap_used > mb->heap_limit) |
||||
+ newsizeK = mb->heap_limit - mb->heap_used; |
||||
+ newsize = newsizeK*(1024/sizeof(int)); |
||||
+ |
||||
if (newsize < RWS_RSIZE + ovecsize + RWS_ANCHOR_SIZE) |
||||
return PCRE2_ERROR_HEAPLIMIT; |
||||
new = mb->memctl.malloc(newsize*sizeof(int), mb->memctl.memory_data); |
||||
if (new == NULL) return PCRE2_ERROR_NOMEMORY; |
||||
- mb->heap_used += newsize; |
||||
+ mb->heap_used += newsizeK; |
||||
new->next = NULL; |
||||
new->size = newsize; |
||||
rws->next = new; |
||||
-- |
||||
2.17.2 |
||||
|
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
From f3b9337a2280db816ef6b2cbe3750b2991944c22 Mon Sep 17 00:00:00 2001 |
||||
From: zherczeg <zherczeg@6239d852-aaf2-0410-a92c-79f79f948069> |
||||
Date: Tue, 18 Sep 2018 10:19:14 +0000 |
||||
Subject: [PATCH] Fix subject buffer overread in JIT. Found by Yunho Kim. |
||||
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@1011 6239d852-aaf2-0410-a92c-79f79f948069 |
||||
|
||||
Petr Písař: Ported to 10.32. The tests were removed because they need |
||||
a new test framework not availanble in 10.32. |
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.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 32e985b..b3015cc 100644 |
||||
--- a/src/pcre2_jit_compile.c |
||||
+++ b/src/pcre2_jit_compile.c |
||||
@@ -9951,7 +9951,7 @@ if (exact > 1) |
||||
#ifdef SUPPORT_UNICODE |
||||
&& !common->utf |
||||
#endif |
||||
- ) |
||||
+ && type != OP_ANYNL && type != OP_EXTUNI) |
||||
{ |
||||
OP2(SLJIT_ADD, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(exact)); |
||||
add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_GREATER, TMP1, 0, STR_END, 0)); |
||||
-- |
||||
2.17.1 |
||||
|
@ -0,0 +1,112 @@
@@ -0,0 +1,112 @@
|
||||
From 977cdd668535a54fc8a13ce4a92d9866503b21ea Mon Sep 17 00:00:00 2001 |
||||
From: ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> |
||||
Date: Sat, 20 Oct 2018 09:28:02 +0000 |
||||
Subject: [PATCH] Fix zero-repeated subroutine call at start of pattern bug, |
||||
which recorded an incorrect first code unit. |
||||
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@1032 6239d852-aaf2-0410-a92c-79f79f948069 |
||||
Petr Písař: Ported to 10.32. |
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com> |
||||
--- |
||||
src/pcre2_compile.c | 8 +++++--- |
||||
testdata/testinput1 | 15 +++++++++++++++ |
||||
testdata/testoutput1 | 24 ++++++++++++++++++++++++ |
||||
3 files changed, 44 insertions(+), 3 deletions(-) |
||||
|
||||
diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c |
||||
index 6bb1de3..50dfd47 100644 |
||||
--- a/src/pcre2_compile.c |
||||
+++ b/src/pcre2_compile.c |
||||
@@ -5901,7 +5901,7 @@ for (;; pptr++) |
||||
} |
||||
goto GROUP_PROCESS_NOTE_EMPTY; |
||||
|
||||
- /* The DEFINE condition is always false. It's internal groups may never |
||||
+ /* The DEFINE condition is always false. Its internal groups may never |
||||
be called, so matched_char must remain false, hence the jump to |
||||
GROUP_PROCESS rather than GROUP_PROCESS_NOTE_EMPTY. */ |
||||
|
||||
@@ -6237,8 +6237,8 @@ for (;; pptr++) |
||||
groupnumber = ng->number; |
||||
|
||||
/* For a recursion, that's all that is needed. We can now go to |
||||
- the code above that handles numerical recursion, applying it to |
||||
- the first group with the given name. */ |
||||
+ the code that handles numerical recursion, applying it to the first |
||||
+ group with the given name. */ |
||||
|
||||
if (meta == META_RECURSE_BYNAME) |
||||
{ |
||||
@@ -7286,6 +7286,8 @@ for (;; pptr++) |
||||
groupsetfirstcu = FALSE; |
||||
cb->had_recurse = TRUE; |
||||
if (firstcuflags == REQ_UNSET) firstcuflags = REQ_NONE; |
||||
+ zerofirstcu = firstcu; |
||||
+ zerofirstcuflags = firstcuflags; |
||||
break; |
||||
|
||||
|
||||
diff --git a/testdata/testinput1 b/testdata/testinput1 |
||||
index d8615ee..fce38b2 100644 |
||||
--- a/testdata/testinput1 |
||||
+++ b/testdata/testinput1 |
||||
@@ -6263,4 +6263,19 @@ ef) x/x,mark |
||||
aBCDEF |
||||
AbCDe f |
||||
|
||||
+/ (?<word> \w+ )* \. /xi |
||||
+ pokus. |
||||
+ |
||||
+/(?(DEFINE) (?<word> \w+ ) ) (?&word)* \./xi |
||||
+ pokus. |
||||
+ |
||||
+/(?(DEFINE) (?<word> \w+ ) ) ( (?&word)* ) \./xi |
||||
+ pokus. |
||||
+ |
||||
+/(?&word)* (?(DEFINE) (?<word> \w+ ) ) \./xi |
||||
+ pokus. |
||||
+ |
||||
+/(?&word)* \. (?<word> \w+ )/xi |
||||
+ pokus.hokus |
||||
+ |
||||
# End of testinput1 |
||||
diff --git a/testdata/testoutput1 b/testdata/testoutput1 |
||||
index 77b9ff0..ff88775 100644 |
||||
--- a/testdata/testoutput1 |
||||
+++ b/testdata/testoutput1 |
||||
@@ -9929,4 +9929,28 @@ No match |
||||
AbCDe f |
||||
No match |
||||
|
||||
+/ (?<word> \w+ )* \. /xi |
||||
+ pokus. |
||||
+ 0: pokus. |
||||
+ 1: pokus |
||||
+ |
||||
+/(?(DEFINE) (?<word> \w+ ) ) (?&word)* \./xi |
||||
+ pokus. |
||||
+ 0: pokus. |
||||
+ |
||||
+/(?(DEFINE) (?<word> \w+ ) ) ( (?&word)* ) \./xi |
||||
+ pokus. |
||||
+ 0: pokus. |
||||
+ 1: <unset> |
||||
+ 2: pokus |
||||
+ |
||||
+/(?&word)* (?(DEFINE) (?<word> \w+ ) ) \./xi |
||||
+ pokus. |
||||
+ 0: pokus. |
||||
+ |
||||
+/(?&word)* \. (?<word> \w+ )/xi |
||||
+ pokus.hokus |
||||
+ 0: pokus.hokus |
||||
+ 1: hokus |
||||
+ |
||||
# End of testinput1 |
||||
-- |
||||
2.17.2 |
||||
|
Loading…
Reference in new issue