1 Description: Apply upstream revision 1631 (Closes: #815921)
2 This is an upstream patch to fix workspace overflow for (*ACCEPT) with
3 deeply nested parentheses
4 Author: Matthew Vernon <matthew@debian.org>
5 X-Dgit-Generated: 2:8.38-2 50aa7778a6bb8b81a9e03e8744f797362183772e
9 --- pcre3-8.38.orig/pcreposix.c
10 +++ pcre3-8.38/pcreposix.c
12 and semantics are as close as possible to those of the Perl 5 language.
14 Written by Philip Hazel
15 - Copyright (c) 1997-2014 University of Cambridge
16 + Copyright (c) 1997-2016 University of Cambridge
18 -----------------------------------------------------------------------------
19 Redistribution and use in source and binary forms, with or without
20 @@ -173,7 +173,8 @@ static const int eint[] = {
21 REG_BADPAT, /* group name must start with a non-digit */
23 REG_BADPAT, /* parentheses too deeply nested (stack check) */
24 - REG_BADPAT /* missing digits in \x{} or \o{} */
25 + REG_BADPAT, /* missing digits in \x{} or \o{} */
26 + REG_BADPAT /* pattern too complicated */
29 /* Table of texts corresponding to POSIX error codes */
30 --- pcre3-8.38.orig/pcre_compile.c
31 +++ pcre3-8.38/pcre_compile.c
33 and semantics are as close as possible to those of the Perl 5 language.
35 Written by Philip Hazel
36 - Copyright (c) 1997-2014 University of Cambridge
37 + Copyright (c) 1997-2016 University of Cambridge
39 -----------------------------------------------------------------------------
40 Redistribution and use in source and binary forms, with or without
41 @@ -560,6 +560,7 @@ static const char error_texts[] =
43 "parentheses are too deeply nested (stack check)\0"
44 "digits missing in \\x{} or \\o{}\0"
45 + "regular expression is too complicated\0"
48 /* Table to identify digits and hex digits. This is used when compiling
49 @@ -4591,7 +4592,8 @@ for (;; ptr++)
50 if (code > cd->start_workspace + cd->workspace_size -
51 WORK_SIZE_SAFETY_MARGIN) /* Check for overrun */
53 - *errorcodeptr = ERR52;
54 + *errorcodeptr = (code >= cd->start_workspace + cd->workspace_size)?
59 @@ -6604,8 +6606,21 @@ for (;; ptr++)
60 cd->had_accept = TRUE;
61 for (oc = cd->open_caps; oc != NULL; oc = oc->next)
64 - PUT2INC(code, 0, oc->number);
65 + if (lengthptr != NULL)
68 + *lengthptr += 1 + IMM2_SIZE;
69 +#elif defined COMPILE_PCRE16
70 + *lengthptr += 2 + IMM2_SIZE;
71 +#elif defined COMPILE_PCRE32
72 + *lengthptr += 4 + IMM2_SIZE;
78 + PUT2INC(code, 0, oc->number);
82 (cd->assert_depth > 0)? OP_ASSERT_ACCEPT : OP_ACCEPT;
83 --- pcre3-8.38.orig/pcre_internal.h
84 +++ pcre3-8.38/pcre_internal.h
86 and semantics are as close as possible to those of the Perl 5 language.
88 Written by Philip Hazel
89 - Copyright (c) 1997-2014 University of Cambridge
90 + Copyright (c) 1997-2016 University of Cambridge
92 -----------------------------------------------------------------------------
93 Redistribution and use in source and binary forms, with or without
94 @@ -2289,7 +2289,7 @@ enum { ERR0, ERR1, ERR2, ERR3, ERR4,
95 ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,
96 ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69,
97 ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79,
98 - ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERRCOUNT };
99 + ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERR87, ERRCOUNT };
101 /* JIT compiling modes. The function list is indexed by them. */
103 --- pcre3-8.38.orig/testdata/testoutput11-8
104 +++ pcre3-8.38/testdata/testoutput11-8
105 @@ -765,4 +765,7 @@ Memory allocation (code space): 10
107 ------------------------------------------------------------------
109 +/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/
110 +Failed: missing ) at offset 509
112 /-- End of testinput11 --/
113 --- pcre3-8.38.orig/testdata/testoutput11-16
114 +++ pcre3-8.38/testdata/testoutput11-16
115 @@ -765,4 +765,7 @@ Memory allocation (code space): 14
117 ------------------------------------------------------------------
119 +/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/
120 +Failed: regular expression is too complicated at offset 490
122 /-- End of testinput11 --/
123 --- pcre3-8.38.orig/testdata/testinput11
124 +++ pcre3-8.38/testdata/testinput11
125 @@ -138,4 +138,6 @@ is required for these tests. --/
129 +/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/
131 /-- End of testinput11 --/
132 --- pcre3-8.38.orig/testdata/testoutput11-32
133 +++ pcre3-8.38/testdata/testoutput11-32
134 @@ -765,4 +765,7 @@ Memory allocation (code space): 28
136 ------------------------------------------------------------------
138 +/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/
139 +Failed: missing ) at offset 509
141 /-- End of testinput11 --/