This repository has been archived by the owner on Dec 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathpcre2-CVE-2017-8786_2.patch
73 lines (65 loc) · 3.12 KB
/
pcre2-CVE-2017-8786_2.patch
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From 3091213a8f163aaad43390229380e22adb096787 Mon Sep 17 00:00:00 2001
From: ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>
Date: Tue, 21 Mar 2017 18:36:13 +0000
Subject: [PATCH 2/2] Previous patch was not quite complete.
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@697 6239d852-aaf2-0410-a92c-79f79f948069
Signed-off-by: Petr Písař <[email protected]>
---
src/pcre2test.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/pcre2test.c b/src/pcre2test.c
index 9289656..b979dd1 100644
--- a/src/pcre2test.c
+++ b/src/pcre2test.c
@@ -1017,9 +1017,9 @@ are supported. */
if (test_mode == PCRE8_MODE) \
r = pcre2_get_error_message_8(a,G(b,8),G(G(b,8),_size)); \
else if (test_mode == PCRE16_MODE) \
- r = pcre2_get_error_message_16(a,G(b,16),G(G(b,16),_size)); \
+ r = pcre2_get_error_message_16(a,G(b,16),G(G(b,16),_size/2)); \
else \
- r = pcre2_get_error_message_32(a,G(b,32),G(G(b,32),_size))
+ r = pcre2_get_error_message_32(a,G(b,32),G(G(b,32),_size/4))
#define PCRE2_GET_OVECTOR_COUNT(a,b) \
if (test_mode == PCRE8_MODE) \
@@ -1399,6 +1399,9 @@ the three different cases. */
/* ----- Common macros for two-mode cases ----- */
+#define BYTEONE (BITONE/8)
+#define BYTETWO (BITTWO/8)
+
#define CASTFLD(t,a,b) \
((test_mode == G(G(PCRE,BITONE),_MODE))? (t)(G(a,BITONE)->b) : \
(t)(G(a,BITTWO)->b))
@@ -1481,9 +1484,9 @@ the three different cases. */
#define PCRE2_GET_ERROR_MESSAGE(r,a,b) \
if (test_mode == G(G(PCRE,BITONE),_MODE)) \
- r = G(pcre2_get_error_message_,BITONE)(a,G(b,BITONE),G(G(b,BITONE),_size)); \
+ r = G(pcre2_get_error_message_,BITONE)(a,G(b,BITONE),G(G(b,BITONE),_size/BYTEONE)); \
else \
- r = G(pcre2_get_error_message_,BITTWO)(a,G(b,BITTWO),G(G(b,BITTWO),_size))
+ r = G(pcre2_get_error_message_,BITTWO)(a,G(b,BITTWO),G(G(b,BITTWO),_size/BYTETWO))
#define PCRE2_GET_OVECTOR_COUNT(a,b) \
if (test_mode == G(G(PCRE,BITONE),_MODE)) \
@@ -1904,7 +1907,7 @@ the three different cases. */
#define PCRE2_DFA_MATCH(a,b,c,d,e,f,g,h,i,j) \
a = pcre2_dfa_match_16(G(b,16),(PCRE2_SPTR16)c,d,e,f,G(g,16),h,i,j)
#define PCRE2_GET_ERROR_MESSAGE(r,a,b) \
- r = pcre2_get_error_message_16(a,G(b,16),G(G(b,16),_size))
+ r = pcre2_get_error_message_16(a,G(b,16),G(G(b,16),_size/2))
#define PCRE2_GET_OVECTOR_COUNT(a,b) a = pcre2_get_ovector_count_16(G(b,16))
#define PCRE2_GET_STARTCHAR(a,b) a = pcre2_get_startchar_16(G(b,16))
#define PCRE2_JIT_COMPILE(r,a,b) r = pcre2_jit_compile_16(G(a,16),b)
@@ -2000,7 +2003,7 @@ the three different cases. */
#define PCRE2_DFA_MATCH(a,b,c,d,e,f,g,h,i,j) \
a = pcre2_dfa_match_32(G(b,32),(PCRE2_SPTR32)c,d,e,f,G(g,32),h,i,j)
#define PCRE2_GET_ERROR_MESSAGE(r,a,b) \
- r = pcre2_get_error_message_32(a,G(b,32),G(G(b,32),_size))
+ r = pcre2_get_error_message_32(a,G(b,32),G(G(b,32),_size/4))
#define PCRE2_GET_OVECTOR_COUNT(a,b) a = pcre2_get_ovector_count_32(G(b,32))
#define PCRE2_GET_STARTCHAR(a,b) a = pcre2_get_startchar_32(G(b,32))
#define PCRE2_JIT_COMPILE(r,a,b) r = pcre2_jit_compile_32(G(a,32),b)
--
2.7.4