Change-Id: I0e4a51628a90fd5b27195aedc4fd6cb4b044aff2
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/1365
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Divya Thaluru <dthaluru@vmware.com>
(cherry picked from commit 44ae28162656040add99e0a7663643dc7855ac2f)
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/1415
Reviewed-by: Xiaolin Li <xiaolinl@vmware.com>
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,1408 +0,0 @@ |
| 1 |
-Submitted By: Ken Moffat <ken at linuxfromscratch dot org> |
|
| 2 |
-Date: 2016-03-16 |
|
| 3 |
-Initial Package Version: 8.38 |
|
| 4 |
-Upstream Status: Applied |
|
| 5 |
-Origin: Upstream, backported to 8.38 by Petr Písař at redhat |
|
| 6 |
-Description: Various fixes, including for CVE-2016-1263 and many other |
|
| 7 |
-bugs which have been fixed upstream. Many of these bugs were found by |
|
| 8 |
-fuzzing, upstream is trying to persuade its users to move to pcre2 and |
|
| 9 |
-giving low priority to further pcre1 maintenance releases. |
|
| 10 |
- |
|
| 11 |
-From 3c80e02cd464ea049e117b423fd48fab294c51a9 Mon Sep 17 00:00:00 2001 |
|
| 12 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 13 |
-Date: Thu, 26 Nov 2015 20:29:13 +0000 |
|
| 14 |
-Subject: [PATCH] Fix auto-callout (?# comment bug. |
|
| 15 |
-MIME-Version: 1.0 |
|
| 16 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 17 |
-Content-Transfer-Encoding: 8bit |
|
| 18 |
- |
|
| 19 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1611 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 20 |
- |
|
| 21 |
-Petr Pisar: Ported to 8.38. |
|
| 22 |
- |
|
| 23 |
-diff --git a/pcre_compile.c b/pcre_compile.c |
|
| 24 |
-index 4d3b313..3360a8b 100644 |
|
| 25 |
-+++ b/pcre_compile.c |
|
| 26 |
-@@ -4699,6 +4699,23 @@ for (;; ptr++) |
|
| 27 |
- } |
|
| 28 |
- } |
|
| 29 |
- |
|
| 30 |
-+ /* Skip over (?# comments. We need to do this here because we want to know if |
|
| 31 |
-+ the next thing is a quantifier, and these comments may come between an item |
|
| 32 |
-+ and its quantifier. */ |
|
| 33 |
-+ |
|
| 34 |
-+ if (c == CHAR_LEFT_PARENTHESIS && ptr[1] == CHAR_QUESTION_MARK && |
|
| 35 |
-+ ptr[2] == CHAR_NUMBER_SIGN) |
|
| 36 |
-+ {
|
|
| 37 |
-+ ptr += 3; |
|
| 38 |
-+ while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++; |
|
| 39 |
-+ if (*ptr == CHAR_NULL) |
|
| 40 |
-+ {
|
|
| 41 |
-+ *errorcodeptr = ERR18; |
|
| 42 |
-+ goto FAILED; |
|
| 43 |
-+ } |
|
| 44 |
-+ continue; |
|
| 45 |
-+ } |
|
| 46 |
-+ |
|
| 47 |
- /* See if the next thing is a quantifier. */ |
|
| 48 |
- |
|
| 49 |
- is_quantifier = |
|
| 50 |
-@@ -6529,21 +6546,6 @@ for (;; ptr++) |
|
| 51 |
- case CHAR_LEFT_PARENTHESIS: |
|
| 52 |
- ptr++; |
|
| 53 |
- |
|
| 54 |
-- /* First deal with comments. Putting this code right at the start ensures |
|
| 55 |
-- that comments have no bad side effects. */ |
|
| 56 |
-- |
|
| 57 |
-- if (ptr[0] == CHAR_QUESTION_MARK && ptr[1] == CHAR_NUMBER_SIGN) |
|
| 58 |
-- {
|
|
| 59 |
-- ptr += 2; |
|
| 60 |
-- while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++; |
|
| 61 |
-- if (*ptr == CHAR_NULL) |
|
| 62 |
-- {
|
|
| 63 |
-- *errorcodeptr = ERR18; |
|
| 64 |
-- goto FAILED; |
|
| 65 |
-- } |
|
| 66 |
-- continue; |
|
| 67 |
-- } |
|
| 68 |
-- |
|
| 69 |
- /* Now deal with various "verbs" that can be introduced by '*'. */ |
|
| 70 |
- |
|
| 71 |
- if (ptr[0] == CHAR_ASTERISK && (ptr[1] == ':' |
|
| 72 |
-diff --git a/testdata/testinput2 b/testdata/testinput2 |
|
| 73 |
-index e2e520f..92e3359 100644 |
|
| 74 |
-+++ b/testdata/testinput2 |
|
| 75 |
-@@ -4217,4 +4217,12 @@ backtracking verbs. --/ |
|
| 76 |
- |
|
| 77 |
- /a[[:punct:]b]/BZ |
|
| 78 |
- |
|
| 79 |
-+/L(?#(|++<!(2)?/BZ |
|
| 80 |
-+ |
|
| 81 |
-+/L(?#(|++<!(2)?/BOZ |
|
| 82 |
-+ |
|
| 83 |
-+/L(?#(|++<!(2)?/BCZ |
|
| 84 |
-+ |
|
| 85 |
-+/L(?#(|++<!(2)?/BCOZ |
|
| 86 |
-+ |
|
| 87 |
- /-- End of testinput2 --/ |
|
| 88 |
-diff --git a/testdata/testinput7 b/testdata/testinput7 |
|
| 89 |
-index e411a4b..00b9738 100644 |
|
| 90 |
-+++ b/testdata/testinput7 |
|
| 91 |
-@@ -853,4 +853,8 @@ of case for anything other than the ASCII letters. --/ |
|
| 92 |
- |
|
| 93 |
- /a[b[:punct:]]/8WBZ |
|
| 94 |
- |
|
| 95 |
-+/L(?#(|++<!(2)?/B8COZ |
|
| 96 |
-+ |
|
| 97 |
-+/L(?#(|++<!(2)?/B8WCZ |
|
| 98 |
-+ |
|
| 99 |
- /-- End of testinput7 --/ |
|
| 100 |
-diff --git a/testdata/testoutput2 b/testdata/testoutput2 |
|
| 101 |
-index 85c565d..2cf7a90 100644 |
|
| 102 |
-+++ b/testdata/testoutput2 |
|
| 103 |
-@@ -14574,4 +14574,40 @@ No match |
|
| 104 |
- End |
|
| 105 |
- ------------------------------------------------------------------ |
|
| 106 |
- |
|
| 107 |
-+/L(?#(|++<!(2)?/BZ |
|
| 108 |
-+------------------------------------------------------------------ |
|
| 109 |
-+ Bra |
|
| 110 |
-+ L?+ |
|
| 111 |
-+ Ket |
|
| 112 |
-+ End |
|
| 113 |
-+------------------------------------------------------------------ |
|
| 114 |
-+ |
|
| 115 |
-+/L(?#(|++<!(2)?/BOZ |
|
| 116 |
-+------------------------------------------------------------------ |
|
| 117 |
-+ Bra |
|
| 118 |
-+ L? |
|
| 119 |
-+ Ket |
|
| 120 |
-+ End |
|
| 121 |
-+------------------------------------------------------------------ |
|
| 122 |
-+ |
|
| 123 |
-+/L(?#(|++<!(2)?/BCZ |
|
| 124 |
-+------------------------------------------------------------------ |
|
| 125 |
-+ Bra |
|
| 126 |
-+ Callout 255 0 14 |
|
| 127 |
-+ L?+ |
|
| 128 |
-+ Callout 255 14 0 |
|
| 129 |
-+ Ket |
|
| 130 |
-+ End |
|
| 131 |
-+------------------------------------------------------------------ |
|
| 132 |
-+ |
|
| 133 |
-+/L(?#(|++<!(2)?/BCOZ |
|
| 134 |
-+------------------------------------------------------------------ |
|
| 135 |
-+ Bra |
|
| 136 |
-+ Callout 255 0 14 |
|
| 137 |
-+ L? |
|
| 138 |
-+ Callout 255 14 0 |
|
| 139 |
-+ Ket |
|
| 140 |
-+ End |
|
| 141 |
-+------------------------------------------------------------------ |
|
| 142 |
-+ |
|
| 143 |
- /-- End of testinput2 --/ |
|
| 144 |
-diff --git a/testdata/testoutput7 b/testdata/testoutput7 |
|
| 145 |
-index cc9ebdd..fdfff64 100644 |
|
| 146 |
-+++ b/testdata/testoutput7 |
|
| 147 |
-@@ -2348,4 +2348,24 @@ No match |
|
| 148 |
- End |
|
| 149 |
- ------------------------------------------------------------------ |
|
| 150 |
- |
|
| 151 |
-+/L(?#(|++<!(2)?/B8COZ |
|
| 152 |
-+------------------------------------------------------------------ |
|
| 153 |
-+ Bra |
|
| 154 |
-+ Callout 255 0 14 |
|
| 155 |
-+ L? |
|
| 156 |
-+ Callout 255 14 0 |
|
| 157 |
-+ Ket |
|
| 158 |
-+ End |
|
| 159 |
-+------------------------------------------------------------------ |
|
| 160 |
-+ |
|
| 161 |
-+/L(?#(|++<!(2)?/B8WCZ |
|
| 162 |
-+------------------------------------------------------------------ |
|
| 163 |
-+ Bra |
|
| 164 |
-+ Callout 255 0 14 |
|
| 165 |
-+ L?+ |
|
| 166 |
-+ Callout 255 14 0 |
|
| 167 |
-+ Ket |
|
| 168 |
-+ End |
|
| 169 |
-+------------------------------------------------------------------ |
|
| 170 |
-+ |
|
| 171 |
- /-- End of testinput7 --/ |
|
| 172 |
-2.4.3 |
|
| 173 |
- |
|
| 174 |
-From ef6b10fcde41a2687f38d4a9ff2886b037948a1b Mon Sep 17 00:00:00 2001 |
|
| 175 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 176 |
-Date: Fri, 27 Nov 2015 17:13:13 +0000 |
|
| 177 |
-Subject: [PATCH 1/5] Fix negated POSIX class within negated overall class UCP |
|
| 178 |
- bug. |
|
| 179 |
-MIME-Version: 1.0 |
|
| 180 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 181 |
-Content-Transfer-Encoding: 8bit |
|
| 182 |
- |
|
| 183 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1612 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 184 |
- |
|
| 185 |
-Petr Písař: Ported to 8.38. |
|
| 186 |
-diff --git a/pcre_compile.c b/pcre_compile.c |
|
| 187 |
-index 3360a8b..3670f1e 100644 |
|
| 188 |
-+++ b/pcre_compile.c |
|
| 189 |
-@@ -5063,20 +5063,22 @@ for (;; ptr++) |
|
| 190 |
- ptr = tempptr + 1; |
|
| 191 |
- continue; |
|
| 192 |
- |
|
| 193 |
-- /* For the other POSIX classes (ascii, xdigit) we are going to fall |
|
| 194 |
-- through to the non-UCP case and build a bit map for characters with |
|
| 195 |
-- code points less than 256. If we are in a negated POSIX class |
|
| 196 |
-- within a non-negated overall class, characters with code points |
|
| 197 |
-- greater than 255 must all match. In the special case where we have |
|
| 198 |
-- not yet generated any xclass data, and this is the final item in |
|
| 199 |
-- the overall class, we need do nothing: later on, the opcode |
|
| 200 |
-+ /* For the other POSIX classes (ascii, cntrl, xdigit) we are going |
|
| 201 |
-+ to fall through to the non-UCP case and build a bit map for |
|
| 202 |
-+ characters with code points less than 256. If we are in a negated |
|
| 203 |
-+ POSIX class, characters with code points greater than 255 must |
|
| 204 |
-+ either all match or all not match. In the special case where we |
|
| 205 |
-+ have not yet generated any xclass data, and this is the final item |
|
| 206 |
-+ in the overall class, we need do nothing: later on, the opcode |
|
| 207 |
- OP_NCLASS will be used to indicate that characters greater than 255 |
|
| 208 |
- are acceptable. If we have already seen an xclass item or one may |
|
| 209 |
- follow (we have to assume that it might if this is not the end of |
|
| 210 |
-- the class), explicitly match all wide codepoints. */ |
|
| 211 |
-+ the class), explicitly list all wide codepoints, which will then |
|
| 212 |
-+ either not match or match, depending on whether the class is or is |
|
| 213 |
-+ not negated. */ |
|
| 214 |
- |
|
| 215 |
- default: |
|
| 216 |
-- if (!negate_class && local_negate && |
|
| 217 |
-+ if (local_negate && |
|
| 218 |
- (xclass || tempptr[2] != CHAR_RIGHT_SQUARE_BRACKET)) |
|
| 219 |
- {
|
|
| 220 |
- *class_uchardata++ = XCL_RANGE; |
|
| 221 |
-diff --git a/testdata/testinput6 b/testdata/testinput6 |
|
| 222 |
-index aeb62a0..a178d3d 100644 |
|
| 223 |
-+++ b/testdata/testinput6 |
|
| 224 |
-@@ -1553,4 +1553,13 @@ |
|
| 225 |
- \x{200}
|
|
| 226 |
- \x{37e}
|
|
| 227 |
- |
|
| 228 |
-+/[^[:^ascii:]\d]/8W |
|
| 229 |
-+ a |
|
| 230 |
-+ ~ |
|
| 231 |
-+ 0 |
|
| 232 |
-+ \a |
|
| 233 |
-+ \x{7f}
|
|
| 234 |
-+ \x{389}
|
|
| 235 |
-+ \x{20ac}
|
|
| 236 |
-+ |
|
| 237 |
- /-- End of testinput6 --/ |
|
| 238 |
-diff --git a/testdata/testoutput6 b/testdata/testoutput6 |
|
| 239 |
-index beb85aa..b64dc0d 100644 |
|
| 240 |
-+++ b/testdata/testoutput6 |
|
| 241 |
-@@ -2557,4 +2557,20 @@ No match |
|
| 242 |
- \x{37e}
|
|
| 243 |
- 0: \x{37e}
|
|
| 244 |
- |
|
| 245 |
-+/[^[:^ascii:]\d]/8W |
|
| 246 |
-+ a |
|
| 247 |
-+ 0: a |
|
| 248 |
-+ ~ |
|
| 249 |
-+ 0: ~ |
|
| 250 |
-+ 0 |
|
| 251 |
-+No match |
|
| 252 |
-+ \a |
|
| 253 |
-+ 0: \x{07}
|
|
| 254 |
-+ \x{7f}
|
|
| 255 |
-+ 0: \x{7f}
|
|
| 256 |
-+ \x{389}
|
|
| 257 |
-+No match |
|
| 258 |
-+ \x{20ac}
|
|
| 259 |
-+No match |
|
| 260 |
-+ |
|
| 261 |
- /-- End of testinput6 --/ |
|
| 262 |
-2.4.3 |
|
| 263 |
- |
|
| 264 |
-From bfc1dfa660c24dc7a75108d934290e50d7db2719 Mon Sep 17 00:00:00 2001 |
|
| 265 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 266 |
-Date: Fri, 27 Nov 2015 17:41:04 +0000 |
|
| 267 |
-Subject: [PATCH 2/5] Fix bug for isolated \E between an item and its qualifier |
|
| 268 |
- when auto callout is set. |
|
| 269 |
-MIME-Version: 1.0 |
|
| 270 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 271 |
-Content-Transfer-Encoding: 8bit |
|
| 272 |
- |
|
| 273 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1613 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 274 |
- |
|
| 275 |
-Petr Písař: Ported to 8.38. |
|
| 276 |
- |
|
| 277 |
-diff --git a/pcre_compile.c b/pcre_compile.c |
|
| 278 |
-index 3670f1e..5786cd3 100644 |
|
| 279 |
-+++ b/pcre_compile.c |
|
| 280 |
-@@ -4645,9 +4645,10 @@ for (;; ptr++) |
|
| 281 |
- goto FAILED; |
|
| 282 |
- } |
|
| 283 |
- |
|
| 284 |
-- /* If in \Q...\E, check for the end; if not, we have a literal */ |
|
| 285 |
-+ /* If in \Q...\E, check for the end; if not, we have a literal. Otherwise an |
|
| 286 |
-+ isolated \E is ignored. */ |
|
| 287 |
- |
|
| 288 |
-- if (inescq && c != CHAR_NULL) |
|
| 289 |
-+ if (c != CHAR_NULL) |
|
| 290 |
- {
|
|
| 291 |
- if (c == CHAR_BACKSLASH && ptr[1] == CHAR_E) |
|
| 292 |
- {
|
|
| 293 |
-@@ -4655,7 +4656,7 @@ for (;; ptr++) |
|
| 294 |
- ptr++; |
|
| 295 |
- continue; |
|
| 296 |
- } |
|
| 297 |
-- else |
|
| 298 |
-+ else if (inescq) |
|
| 299 |
- {
|
|
| 300 |
- if (previous_callout != NULL) |
|
| 301 |
- {
|
|
| 302 |
-@@ -4670,7 +4671,6 @@ for (;; ptr++) |
|
| 303 |
- } |
|
| 304 |
- goto NORMAL_CHAR; |
|
| 305 |
- } |
|
| 306 |
-- /* Control does not reach here. */ |
|
| 307 |
- } |
|
| 308 |
- |
|
| 309 |
- /* In extended mode, skip white space and comments. We need a loop in order |
|
| 310 |
-diff --git a/testdata/testinput2 b/testdata/testinput2 |
|
| 311 |
-index 92e3359..e8ca4fe 100644 |
|
| 312 |
-+++ b/testdata/testinput2 |
|
| 313 |
-@@ -4225,4 +4225,6 @@ backtracking verbs. --/ |
|
| 314 |
- |
|
| 315 |
- /L(?#(|++<!(2)?/BCOZ |
|
| 316 |
- |
|
| 317 |
-+/(A*)\E+/CBZ |
|
| 318 |
-+ |
|
| 319 |
- /-- End of testinput2 --/ |
|
| 320 |
-diff --git a/testdata/testoutput2 b/testdata/testoutput2 |
|
| 321 |
-index 2cf7a90..09756b8 100644 |
|
| 322 |
-+++ b/testdata/testoutput2 |
|
| 323 |
-@@ -14610,4 +14610,18 @@ No match |
|
| 324 |
- End |
|
| 325 |
- ------------------------------------------------------------------ |
|
| 326 |
- |
|
| 327 |
-+/(A*)\E+/CBZ |
|
| 328 |
-+------------------------------------------------------------------ |
|
| 329 |
-+ Bra |
|
| 330 |
-+ Callout 255 0 7 |
|
| 331 |
-+ SCBra 1 |
|
| 332 |
-+ Callout 255 1 2 |
|
| 333 |
-+ A* |
|
| 334 |
-+ Callout 255 3 0 |
|
| 335 |
-+ KetRmax |
|
| 336 |
-+ Callout 255 7 0 |
|
| 337 |
-+ Ket |
|
| 338 |
-+ End |
|
| 339 |
-+------------------------------------------------------------------ |
|
| 340 |
-+ |
|
| 341 |
- /-- End of testinput2 --/ |
|
| 342 |
-2.4.3 |
|
| 343 |
- |
|
| 344 |
-From 108377b836fc29a84f5286287629d96549b1c777 Mon Sep 17 00:00:00 2001 |
|
| 345 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 346 |
-Date: Sun, 29 Nov 2015 17:38:25 +0000 |
|
| 347 |
-Subject: [PATCH 3/5] Give error for regexec with pmatch=NULL and REG_STARTEND |
|
| 348 |
- set. |
|
| 349 |
-MIME-Version: 1.0 |
|
| 350 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 351 |
-Content-Transfer-Encoding: 8bit |
|
| 352 |
- |
|
| 353 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1614 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 354 |
- |
|
| 355 |
-Petr Písař: Ported to 8.38. |
|
| 356 |
- |
|
| 357 |
-diff --git a/pcreposix.c b/pcreposix.c |
|
| 358 |
-index f024423..dcc13ef 100644 |
|
| 359 |
-+++ b/pcreposix.c |
|
| 360 |
-@@ -364,6 +364,7 @@ start location rather than being passed as a PCRE "starting offset". */ |
|
| 361 |
- |
|
| 362 |
- if ((eflags & REG_STARTEND) != 0) |
|
| 363 |
- {
|
|
| 364 |
-+ if (pmatch == NULL) return REG_INVARG; |
|
| 365 |
- so = pmatch[0].rm_so; |
|
| 366 |
- eo = pmatch[0].rm_eo; |
|
| 367 |
- } |
|
| 368 |
-2.4.3 |
|
| 369 |
- |
|
| 370 |
-From e347b40d5bb12f7ef1e632aa649571a107be7d8a Mon Sep 17 00:00:00 2001 |
|
| 371 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 372 |
-Date: Sun, 29 Nov 2015 17:46:23 +0000 |
|
| 373 |
-Subject: [PATCH 4/5] Allow for up to 32-bit numbers in the ordin() function in |
|
| 374 |
- pcregrep. |
|
| 375 |
-MIME-Version: 1.0 |
|
| 376 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 377 |
-Content-Transfer-Encoding: 8bit |
|
| 378 |
- |
|
| 379 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1615 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 380 |
- |
|
| 381 |
-Petr Písař: Ported to 8.38. |
|
| 382 |
- |
|
| 383 |
-diff --git a/pcregrep.c b/pcregrep.c |
|
| 384 |
-index 64986b0..cd53c64 100644 |
|
| 385 |
-+++ b/pcregrep.c |
|
| 386 |
-@@ -2437,7 +2437,7 @@ return options; |
|
| 387 |
- static char * |
|
| 388 |
- ordin(int n) |
|
| 389 |
- {
|
|
| 390 |
--static char buffer[8]; |
|
| 391 |
-+static char buffer[14]; |
|
| 392 |
- char *p = buffer; |
|
| 393 |
- sprintf(p, "%d", n); |
|
| 394 |
- while (*p != 0) p++; |
|
| 395 |
-2.4.3 |
|
| 396 |
- |
|
| 397 |
-From e78ad4264b16988b826bd2939a1781c1165a92d9 Mon Sep 17 00:00:00 2001 |
|
| 398 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 399 |
-Date: Mon, 30 Nov 2015 17:44:45 +0000 |
|
| 400 |
-Subject: [PATCH 5/5] Fix \Q\E before qualifier bug when auto callouts are |
|
| 401 |
- enabled. |
|
| 402 |
-MIME-Version: 1.0 |
|
| 403 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 404 |
-Content-Transfer-Encoding: 8bit |
|
| 405 |
- |
|
| 406 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1616 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 407 |
- |
|
| 408 |
-Petr Písař: Ported to 8.38. |
|
| 409 |
- |
|
| 410 |
-diff --git a/pcre_compile.c b/pcre_compile.c |
|
| 411 |
-index 5786cd3..beed46b 100644 |
|
| 412 |
-+++ b/pcre_compile.c |
|
| 413 |
-@@ -4671,17 +4671,27 @@ for (;; ptr++) |
|
| 414 |
- } |
|
| 415 |
- goto NORMAL_CHAR; |
|
| 416 |
- } |
|
| 417 |
-+ |
|
| 418 |
-+ /* Check for the start of a \Q...\E sequence. We must do this here rather |
|
| 419 |
-+ than later in case it is immediately followed by \E, which turns it into a |
|
| 420 |
-+ "do nothing" sequence. */ |
|
| 421 |
-+ |
|
| 422 |
-+ if (c == CHAR_BACKSLASH && ptr[1] == CHAR_Q) |
|
| 423 |
-+ {
|
|
| 424 |
-+ inescq = TRUE; |
|
| 425 |
-+ ptr++; |
|
| 426 |
-+ continue; |
|
| 427 |
-+ } |
|
| 428 |
- } |
|
| 429 |
- |
|
| 430 |
-- /* In extended mode, skip white space and comments. We need a loop in order |
|
| 431 |
-- to check for more white space and more comments after a comment. */ |
|
| 432 |
-+ /* In extended mode, skip white space and comments. */ |
|
| 433 |
- |
|
| 434 |
- if ((options & PCRE_EXTENDED) != 0) |
|
| 435 |
- {
|
|
| 436 |
-- for (;;) |
|
| 437 |
-+ const pcre_uchar *wscptr = ptr; |
|
| 438 |
-+ while (MAX_255(c) && (cd->ctypes[c] & ctype_space) != 0) c = *(++ptr); |
|
| 439 |
-+ if (c == CHAR_NUMBER_SIGN) |
|
| 440 |
- {
|
|
| 441 |
-- while (MAX_255(c) && (cd->ctypes[c] & ctype_space) != 0) c = *(++ptr); |
|
| 442 |
-- if (c != CHAR_NUMBER_SIGN) break; |
|
| 443 |
- ptr++; |
|
| 444 |
- while (*ptr != CHAR_NULL) |
|
| 445 |
- {
|
|
| 446 |
-@@ -4695,7 +4705,15 @@ for (;; ptr++) |
|
| 447 |
- if (utf) FORWARDCHAR(ptr); |
|
| 448 |
- #endif |
|
| 449 |
- } |
|
| 450 |
-- c = *ptr; /* Either NULL or the char after a newline */ |
|
| 451 |
-+ } |
|
| 452 |
-+ |
|
| 453 |
-+ /* If we skipped any characters, restart the loop. Otherwise, we didn't see |
|
| 454 |
-+ a comment. */ |
|
| 455 |
-+ |
|
| 456 |
-+ if (ptr > wscptr) |
|
| 457 |
-+ {
|
|
| 458 |
-+ ptr--; |
|
| 459 |
-+ continue; |
|
| 460 |
- } |
|
| 461 |
- } |
|
| 462 |
- |
|
| 463 |
-@@ -7900,16 +7918,6 @@ for (;; ptr++) |
|
| 464 |
- c = ec; |
|
| 465 |
- else |
|
| 466 |
- {
|
|
| 467 |
-- if (escape == ESC_Q) /* Handle start of quoted string */ |
|
| 468 |
-- {
|
|
| 469 |
-- if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E) |
|
| 470 |
-- ptr += 2; /* avoid empty string */ |
|
| 471 |
-- else inescq = TRUE; |
|
| 472 |
-- continue; |
|
| 473 |
-- } |
|
| 474 |
-- |
|
| 475 |
-- if (escape == ESC_E) continue; /* Perl ignores an orphan \E */ |
|
| 476 |
-- |
|
| 477 |
- /* For metasequences that actually match a character, we disable the |
|
| 478 |
- setting of a first character if it hasn't already been set. */ |
|
| 479 |
- |
|
| 480 |
-diff --git a/testdata/testinput2 b/testdata/testinput2 |
|
| 481 |
-index e8ca4fe..3a1134f 100644 |
|
| 482 |
-+++ b/testdata/testinput2 |
|
| 483 |
-@@ -4227,4 +4227,6 @@ backtracking verbs. --/ |
|
| 484 |
- |
|
| 485 |
- /(A*)\E+/CBZ |
|
| 486 |
- |
|
| 487 |
-+/()\Q\E*]/BCZ |
|
| 488 |
-+ |
|
| 489 |
- /-- End of testinput2 --/ |
|
| 490 |
-diff --git a/testdata/testoutput2 b/testdata/testoutput2 |
|
| 491 |
-index 09756b8..ac33cc4 100644 |
|
| 492 |
-+++ b/testdata/testoutput2 |
|
| 493 |
-@@ -14624,4 +14624,19 @@ No match |
|
| 494 |
- End |
|
| 495 |
- ------------------------------------------------------------------ |
|
| 496 |
- |
|
| 497 |
-+/()\Q\E*]/BCZ |
|
| 498 |
-+------------------------------------------------------------------ |
|
| 499 |
-+ Bra |
|
| 500 |
-+ Callout 255 0 7 |
|
| 501 |
-+ Brazero |
|
| 502 |
-+ SCBra 1 |
|
| 503 |
-+ Callout 255 1 0 |
|
| 504 |
-+ KetRmax |
|
| 505 |
-+ Callout 255 7 1 |
|
| 506 |
-+ ] |
|
| 507 |
-+ Callout 255 8 0 |
|
| 508 |
-+ Ket |
|
| 509 |
-+ End |
|
| 510 |
-+------------------------------------------------------------------ |
|
| 511 |
-+ |
|
| 512 |
- /-- End of testinput2 --/ |
|
| 513 |
-2.4.3 |
|
| 514 |
- |
|
| 515 |
-From 46ed1a703b067e5b679eacf6500a54dae35f8130 Mon Sep 17 00:00:00 2001 |
|
| 516 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 517 |
-Date: Thu, 3 Dec 2015 17:05:40 +0000 |
|
| 518 |
-Subject: [PATCH] Fix /x bug when pattern starts with white space and (?-x) |
|
| 519 |
-MIME-Version: 1.0 |
|
| 520 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 521 |
-Content-Transfer-Encoding: 8bit |
|
| 522 |
- |
|
| 523 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1617 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 524 |
- |
|
| 525 |
-Petr Písař: Ported to 8.38. |
|
| 526 |
- |
|
| 527 |
-diff --git a/pcre_compile.c b/pcre_compile.c |
|
| 528 |
-index beed46b..57719b9 100644 |
|
| 529 |
-+++ b/pcre_compile.c |
|
| 530 |
-@@ -7607,39 +7607,15 @@ for (;; ptr++) |
|
| 531 |
- newoptions = (options | set) & (~unset); |
|
| 532 |
- |
|
| 533 |
- /* If the options ended with ')' this is not the start of a nested |
|
| 534 |
-- group with option changes, so the options change at this level. If this |
|
| 535 |
-- item is right at the start of the pattern, the options can be |
|
| 536 |
-- abstracted and made external in the pre-compile phase, and ignored in |
|
| 537 |
-- the compile phase. This can be helpful when matching -- for instance in |
|
| 538 |
-- caseless checking of required bytes. |
|
| 539 |
-- |
|
| 540 |
-- If the code pointer is not (cd->start_code + 1 + LINK_SIZE), we are |
|
| 541 |
-- definitely *not* at the start of the pattern because something has been |
|
| 542 |
-- compiled. In the pre-compile phase, however, the code pointer can have |
|
| 543 |
-- that value after the start, because it gets reset as code is discarded |
|
| 544 |
-- during the pre-compile. However, this can happen only at top level - if |
|
| 545 |
-- we are within parentheses, the starting BRA will still be present. At |
|
| 546 |
-- any parenthesis level, the length value can be used to test if anything |
|
| 547 |
-- has been compiled at that level. Thus, a test for both these conditions |
|
| 548 |
-- is necessary to ensure we correctly detect the start of the pattern in |
|
| 549 |
-- both phases. |
|
| 550 |
-- |
|
| 551 |
-+ group with option changes, so the options change at this level. |
|
| 552 |
- If we are not at the pattern start, reset the greedy defaults and the |
|
| 553 |
- case value for firstchar and reqchar. */ |
|
| 554 |
- |
|
| 555 |
- if (*ptr == CHAR_RIGHT_PARENTHESIS) |
|
| 556 |
- {
|
|
| 557 |
-- if (code == cd->start_code + 1 + LINK_SIZE && |
|
| 558 |
-- (lengthptr == NULL || *lengthptr == 2 + 2*LINK_SIZE)) |
|
| 559 |
-- {
|
|
| 560 |
-- cd->external_options = newoptions; |
|
| 561 |
-- } |
|
| 562 |
-- else |
|
| 563 |
-- {
|
|
| 564 |
-- greedy_default = ((newoptions & PCRE_UNGREEDY) != 0); |
|
| 565 |
-- greedy_non_default = greedy_default ^ 1; |
|
| 566 |
-- req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS:0; |
|
| 567 |
-- } |
|
| 568 |
-+ greedy_default = ((newoptions & PCRE_UNGREEDY) != 0); |
|
| 569 |
-+ greedy_non_default = greedy_default ^ 1; |
|
| 570 |
-+ req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS:0; |
|
| 571 |
- |
|
| 572 |
- /* Change options at this level, and pass them back for use |
|
| 573 |
- in subsequent branches. */ |
|
| 574 |
-diff --git a/testdata/testoutput2 b/testdata/testoutput2 |
|
| 575 |
-index ac33cc4..6c42897 100644 |
|
| 576 |
-+++ b/testdata/testoutput2 |
|
| 577 |
-@@ -419,7 +419,7 @@ Need char = '>' |
|
| 578 |
- |
|
| 579 |
- /(?U)<.*>/I |
|
| 580 |
- Capturing subpattern count = 0 |
|
| 581 |
--Options: ungreedy |
|
| 582 |
-+No options |
|
| 583 |
- First char = '<' |
|
| 584 |
- Need char = '>' |
|
| 585 |
- abc<def>ghi<klm>nop |
|
| 586 |
-@@ -443,7 +443,7 @@ Need char = '=' |
|
| 587 |
- |
|
| 588 |
- /(?U)={3,}?/I
|
|
| 589 |
- Capturing subpattern count = 0 |
|
| 590 |
--Options: ungreedy |
|
| 591 |
-+No options |
|
| 592 |
- First char = '=' |
|
| 593 |
- Need char = '=' |
|
| 594 |
- abc========def |
|
| 595 |
-@@ -477,7 +477,7 @@ Failed: lookbehind assertion is not fixed length at offset 12 |
|
| 596 |
- |
|
| 597 |
- /(?i)abc/I |
|
| 598 |
- Capturing subpattern count = 0 |
|
| 599 |
--Options: caseless |
|
| 600 |
-+No options |
|
| 601 |
- First char = 'a' (caseless) |
|
| 602 |
- Need char = 'c' (caseless) |
|
| 603 |
- |
|
| 604 |
-@@ -489,7 +489,7 @@ No need char |
|
| 605 |
- |
|
| 606 |
- /(?i)^1234/I |
|
| 607 |
- Capturing subpattern count = 0 |
|
| 608 |
--Options: anchored caseless |
|
| 609 |
-+Options: anchored |
|
| 610 |
- No first char |
|
| 611 |
- No need char |
|
| 612 |
- |
|
| 613 |
-@@ -502,7 +502,7 @@ No need char |
|
| 614 |
- /(?s).*/I |
|
| 615 |
- Capturing subpattern count = 0 |
|
| 616 |
- May match empty string |
|
| 617 |
--Options: anchored dotall |
|
| 618 |
-+Options: anchored |
|
| 619 |
- No first char |
|
| 620 |
- No need char |
|
| 621 |
- |
|
| 622 |
-@@ -516,7 +516,7 @@ Starting chars: a b c d |
|
| 623 |
- |
|
| 624 |
- /(?i)[abcd]/IS |
|
| 625 |
- Capturing subpattern count = 0 |
|
| 626 |
--Options: caseless |
|
| 627 |
-+No options |
|
| 628 |
- No first char |
|
| 629 |
- No need char |
|
| 630 |
- Subject length lower bound = 1 |
|
| 631 |
-@@ -524,7 +524,7 @@ Starting chars: A B C D a b c d |
|
| 632 |
- |
|
| 633 |
- /(?m)[xy]|(b|c)/IS |
|
| 634 |
- Capturing subpattern count = 1 |
|
| 635 |
--Options: multiline |
|
| 636 |
-+No options |
|
| 637 |
- No first char |
|
| 638 |
- No need char |
|
| 639 |
- Subject length lower bound = 1 |
|
| 640 |
-@@ -538,7 +538,7 @@ No need char |
|
| 641 |
- |
|
| 642 |
- /(?i)(^a|^b)/Im |
|
| 643 |
- Capturing subpattern count = 1 |
|
| 644 |
--Options: caseless multiline |
|
| 645 |
-+Options: multiline |
|
| 646 |
- First char at start or follows newline |
|
| 647 |
- No need char |
|
| 648 |
- |
|
| 649 |
-@@ -1179,7 +1179,7 @@ No need char |
|
| 650 |
- End |
|
| 651 |
- ------------------------------------------------------------------ |
|
| 652 |
- Capturing subpattern count = 1 |
|
| 653 |
--Options: anchored dotall |
|
| 654 |
-+Options: anchored |
|
| 655 |
- No first char |
|
| 656 |
- No need char |
|
| 657 |
- |
|
| 658 |
-@@ -2735,7 +2735,7 @@ No match |
|
| 659 |
- End |
|
| 660 |
- ------------------------------------------------------------------ |
|
| 661 |
- Capturing subpattern count = 0 |
|
| 662 |
--Options: caseless extended |
|
| 663 |
-+Options: extended |
|
| 664 |
- First char = 'a' (caseless) |
|
| 665 |
- Need char = 'c' (caseless) |
|
| 666 |
- |
|
| 667 |
-@@ -2748,7 +2748,7 @@ Need char = 'c' (caseless) |
|
| 668 |
- End |
|
| 669 |
- ------------------------------------------------------------------ |
|
| 670 |
- Capturing subpattern count = 0 |
|
| 671 |
--Options: caseless extended |
|
| 672 |
-+Options: extended |
|
| 673 |
- First char = 'a' (caseless) |
|
| 674 |
- Need char = 'c' (caseless) |
|
| 675 |
- |
|
| 676 |
-@@ -3095,7 +3095,7 @@ Need char = 'b' |
|
| 677 |
- End |
|
| 678 |
- ------------------------------------------------------------------ |
|
| 679 |
- Capturing subpattern count = 0 |
|
| 680 |
--Options: ungreedy |
|
| 681 |
-+No options |
|
| 682 |
- First char = 'x' |
|
| 683 |
- Need char = 'b' |
|
| 684 |
- xaaaab |
|
| 685 |
-@@ -3497,7 +3497,7 @@ Need char = 'c' |
|
| 686 |
- |
|
| 687 |
- /(?i)[ab]/IS |
|
| 688 |
- Capturing subpattern count = 0 |
|
| 689 |
--Options: caseless |
|
| 690 |
-+No options |
|
| 691 |
- No first char |
|
| 692 |
- No need char |
|
| 693 |
- Subject length lower bound = 1 |
|
| 694 |
-@@ -6299,7 +6299,7 @@ Capturing subpattern count = 3 |
|
| 695 |
- Named capturing subpatterns: |
|
| 696 |
- A 2 |
|
| 697 |
- A 3 |
|
| 698 |
--Options: anchored dupnames |
|
| 699 |
-+Options: anchored |
|
| 700 |
- Duplicate name status changes |
|
| 701 |
- No first char |
|
| 702 |
- No need char |
|
| 703 |
-2.4.3 |
|
| 704 |
- |
|
| 705 |
-From db1fb68feddc9afe6f8822d099fa9ff25e3ea8e7 Mon Sep 17 00:00:00 2001 |
|
| 706 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 707 |
-Date: Sat, 5 Dec 2015 16:30:14 +0000 |
|
| 708 |
-Subject: [PATCH] Fix copy named substring bug. |
|
| 709 |
-MIME-Version: 1.0 |
|
| 710 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 711 |
-Content-Transfer-Encoding: 8bit |
|
| 712 |
- |
|
| 713 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1618 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 714 |
- |
|
| 715 |
-Petr Písař: Ported to 8.38. |
|
| 716 |
-diff --git a/pcre_get.c b/pcre_get.c |
|
| 717 |
-index 8094b34..41eda9c 100644 |
|
| 718 |
-+++ b/pcre_get.c |
|
| 719 |
-@@ -250,6 +250,7 @@ Arguments: |
|
| 720 |
- code the compiled regex |
|
| 721 |
- stringname the name of the capturing substring |
|
| 722 |
- ovector the vector of matched substrings |
|
| 723 |
-+ stringcount number of captured substrings |
|
| 724 |
- |
|
| 725 |
- Returns: the number of the first that is set, |
|
| 726 |
- or the number of the last one if none are set, |
|
| 727 |
-@@ -258,13 +259,16 @@ Returns: the number of the first that is set, |
|
| 728 |
- |
|
| 729 |
- #if defined COMPILE_PCRE8 |
|
| 730 |
- static int |
|
| 731 |
--get_first_set(const pcre *code, const char *stringname, int *ovector) |
|
| 732 |
-+get_first_set(const pcre *code, const char *stringname, int *ovector, |
|
| 733 |
-+ int stringcount) |
|
| 734 |
- #elif defined COMPILE_PCRE16 |
|
| 735 |
- static int |
|
| 736 |
--get_first_set(const pcre16 *code, PCRE_SPTR16 stringname, int *ovector) |
|
| 737 |
-+get_first_set(const pcre16 *code, PCRE_SPTR16 stringname, int *ovector, |
|
| 738 |
-+ int stringcount) |
|
| 739 |
- #elif defined COMPILE_PCRE32 |
|
| 740 |
- static int |
|
| 741 |
--get_first_set(const pcre32 *code, PCRE_SPTR32 stringname, int *ovector) |
|
| 742 |
-+get_first_set(const pcre32 *code, PCRE_SPTR32 stringname, int *ovector, |
|
| 743 |
-+ int stringcount) |
|
| 744 |
- #endif |
|
| 745 |
- {
|
|
| 746 |
- const REAL_PCRE *re = (const REAL_PCRE *)code; |
|
| 747 |
-@@ -295,7 +299,7 @@ if (entrysize <= 0) return entrysize; |
|
| 748 |
- for (entry = (pcre_uchar *)first; entry <= (pcre_uchar *)last; entry += entrysize) |
|
| 749 |
- {
|
|
| 750 |
- int n = GET2(entry, 0); |
|
| 751 |
-- if (ovector[n*2] >= 0) return n; |
|
| 752 |
-+ if (n < stringcount && ovector[n*2] >= 0) return n; |
|
| 753 |
- } |
|
| 754 |
- return GET2(entry, 0); |
|
| 755 |
- } |
|
| 756 |
-@@ -402,7 +406,7 @@ pcre32_copy_named_substring(const pcre32 *code, PCRE_SPTR32 subject, |
|
| 757 |
- PCRE_UCHAR32 *buffer, int size) |
|
| 758 |
- #endif |
|
| 759 |
- {
|
|
| 760 |
--int n = get_first_set(code, stringname, ovector); |
|
| 761 |
-+int n = get_first_set(code, stringname, ovector, stringcount); |
|
| 762 |
- if (n <= 0) return n; |
|
| 763 |
- #if defined COMPILE_PCRE8 |
|
| 764 |
- return pcre_copy_substring(subject, ovector, stringcount, n, buffer, size); |
|
| 765 |
-@@ -619,7 +623,7 @@ pcre32_get_named_substring(const pcre32 *code, PCRE_SPTR32 subject, |
|
| 766 |
- PCRE_SPTR32 *stringptr) |
|
| 767 |
- #endif |
|
| 768 |
- {
|
|
| 769 |
--int n = get_first_set(code, stringname, ovector); |
|
| 770 |
-+int n = get_first_set(code, stringname, ovector, stringcount); |
|
| 771 |
- if (n <= 0) return n; |
|
| 772 |
- #if defined COMPILE_PCRE8 |
|
| 773 |
- return pcre_get_substring(subject, ovector, stringcount, n, stringptr); |
|
| 774 |
-diff --git a/testdata/testinput2 b/testdata/testinput2 |
|
| 775 |
-index 3a1134f..00ffe32 100644 |
|
| 776 |
-+++ b/testdata/testinput2 |
|
| 777 |
-@@ -4229,4 +4229,7 @@ backtracking verbs. --/ |
|
| 778 |
- |
|
| 779 |
- /()\Q\E*]/BCZ |
|
| 780 |
- |
|
| 781 |
-+/(?<A>)(?J:(?<B>)(?<B>))(?<C>)/ |
|
| 782 |
-+ \O\CC |
|
| 783 |
-+ |
|
| 784 |
- /-- End of testinput2 --/ |
|
| 785 |
-diff --git a/testdata/testoutput2 b/testdata/testoutput2 |
|
| 786 |
-index 6c42897..ffb4466 100644 |
|
| 787 |
-+++ b/testdata/testoutput2 |
|
| 788 |
-@@ -14639,4 +14639,9 @@ No match |
|
| 789 |
- End |
|
| 790 |
- ------------------------------------------------------------------ |
|
| 791 |
- |
|
| 792 |
-+/(?<A>)(?J:(?<B>)(?<B>))(?<C>)/ |
|
| 793 |
-+ \O\CC |
|
| 794 |
-+Matched, but too many substrings |
|
| 795 |
-+copy substring C failed -7 |
|
| 796 |
-+ |
|
| 797 |
- /-- End of testinput2 --/ |
|
| 798 |
-2.4.3 |
|
| 799 |
- |
|
| 800 |
-From 40363ebc19baeab160abaaa55dc84322a89ac35a Mon Sep 17 00:00:00 2001 |
|
| 801 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 802 |
-Date: Sat, 5 Dec 2015 16:58:46 +0000 |
|
| 803 |
-Subject: [PATCH] Fix (by hacking) another length computation issue. |
|
| 804 |
-MIME-Version: 1.0 |
|
| 805 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 806 |
-Content-Transfer-Encoding: 8bit |
|
| 807 |
- |
|
| 808 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1619 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 809 |
- |
|
| 810 |
-Petr Písař: Ported to 8.38. |
|
| 811 |
- |
|
| 812 |
-diff --git a/pcre_compile.c b/pcre_compile.c |
|
| 813 |
-index 57719b9..087bf2a 100644 |
|
| 814 |
-+++ b/pcre_compile.c |
|
| 815 |
-@@ -7280,7 +7280,7 @@ for (;; ptr++) |
|
| 816 |
- issue is fixed "properly" in PCRE2. As PCRE1 is now in maintenance |
|
| 817 |
- only mode, we finesse the bug by allowing more memory always. */ |
|
| 818 |
- |
|
| 819 |
-- *lengthptr += 2 + 2*LINK_SIZE; |
|
| 820 |
-+ *lengthptr += 4 + 4*LINK_SIZE; |
|
| 821 |
- |
|
| 822 |
- /* It is even worse than that. The current reference may be to an |
|
| 823 |
- existing named group with a different number (so apparently not |
|
| 824 |
-diff --git a/testdata/testoutput11-16 b/testdata/testoutput11-16 |
|
| 825 |
-index 9a0a12d..280692e 100644 |
|
| 826 |
-+++ b/testdata/testoutput11-16 |
|
| 827 |
-@@ -231,7 +231,7 @@ Memory allocation (code space): 73 |
|
| 828 |
- ------------------------------------------------------------------ |
|
| 829 |
- |
|
| 830 |
- /(?P<a>a)...(?P=a)bbb(?P>a)d/BM |
|
| 831 |
--Memory allocation (code space): 77 |
|
| 832 |
-+Memory allocation (code space): 93 |
|
| 833 |
- ------------------------------------------------------------------ |
|
| 834 |
- 0 24 Bra |
|
| 835 |
- 2 5 CBra 1 |
|
| 836 |
-diff --git a/testdata/testoutput11-32 b/testdata/testoutput11-32 |
|
| 837 |
-index 57e5da0..cdbda74 100644 |
|
| 838 |
-+++ b/testdata/testoutput11-32 |
|
| 839 |
-@@ -231,7 +231,7 @@ Memory allocation (code space): 155 |
|
| 840 |
- ------------------------------------------------------------------ |
|
| 841 |
- |
|
| 842 |
- /(?P<a>a)...(?P=a)bbb(?P>a)d/BM |
|
| 843 |
--Memory allocation (code space): 157 |
|
| 844 |
-+Memory allocation (code space): 189 |
|
| 845 |
- ------------------------------------------------------------------ |
|
| 846 |
- 0 24 Bra |
|
| 847 |
- 2 5 CBra 1 |
|
| 848 |
-diff --git a/testdata/testoutput11-8 b/testdata/testoutput11-8 |
|
| 849 |
-index 748548a..cb37896 100644 |
|
| 850 |
-+++ b/testdata/testoutput11-8 |
|
| 851 |
-@@ -231,7 +231,7 @@ Memory allocation (code space): 45 |
|
| 852 |
- ------------------------------------------------------------------ |
|
| 853 |
- |
|
| 854 |
- /(?P<a>a)...(?P=a)bbb(?P>a)d/BM |
|
| 855 |
--Memory allocation (code space): 50 |
|
| 856 |
-+Memory allocation (code space): 62 |
|
| 857 |
- ------------------------------------------------------------------ |
|
| 858 |
- 0 30 Bra |
|
| 859 |
- 3 7 CBra 1 |
|
| 860 |
-2.4.3 |
|
| 861 |
- |
|
| 862 |
-From 4f47274a2eb10131d88145ad7fd0eed4027a0c51 Mon Sep 17 00:00:00 2001 |
|
| 863 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 864 |
-Date: Tue, 8 Dec 2015 11:06:40 +0000 |
|
| 865 |
-Subject: [PATCH] Fix get_substring_list() bug when \K is used in an assertion. |
|
| 866 |
-MIME-Version: 1.0 |
|
| 867 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 868 |
-Content-Transfer-Encoding: 8bit |
|
| 869 |
- |
|
| 870 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1620 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 871 |
- |
|
| 872 |
-Petr Písař: ported to 8.38. |
|
| 873 |
- |
|
| 874 |
-diff --git a/pcre_get.c b/pcre_get.c |
|
| 875 |
-index 41eda9c..cdd2abc 100644 |
|
| 876 |
-+++ b/pcre_get.c |
|
| 877 |
-@@ -461,7 +461,10 @@ pcre_uchar **stringlist; |
|
| 878 |
- pcre_uchar *p; |
|
| 879 |
- |
|
| 880 |
- for (i = 0; i < double_count; i += 2) |
|
| 881 |
-- size += sizeof(pcre_uchar *) + IN_UCHARS(ovector[i+1] - ovector[i] + 1); |
|
| 882 |
-+ {
|
|
| 883 |
-+ size += sizeof(pcre_uchar *) + IN_UCHARS(1); |
|
| 884 |
-+ if (ovector[i+1] > ovector[i]) size += IN_UCHARS(ovector[i+1] - ovector[i]); |
|
| 885 |
-+ } |
|
| 886 |
- |
|
| 887 |
- stringlist = (pcre_uchar **)(PUBL(malloc))(size); |
|
| 888 |
- if (stringlist == NULL) return PCRE_ERROR_NOMEMORY; |
|
| 889 |
-@@ -477,7 +480,7 @@ p = (pcre_uchar *)(stringlist + stringcount + 1); |
|
| 890 |
- |
|
| 891 |
- for (i = 0; i < double_count; i += 2) |
|
| 892 |
- {
|
|
| 893 |
-- int len = ovector[i+1] - ovector[i]; |
|
| 894 |
-+ int len = (ovector[i+1] > ovector[i])? (ovector[i+1] - ovector[i]) : 0; |
|
| 895 |
- memcpy(p, subject + ovector[i], IN_UCHARS(len)); |
|
| 896 |
- *stringlist++ = p; |
|
| 897 |
- p += len; |
|
| 898 |
-diff --git a/testdata/testinput2 b/testdata/testinput2 |
|
| 899 |
-index 00ffe32..967a241 100644 |
|
| 900 |
-+++ b/testdata/testinput2 |
|
| 901 |
-@@ -4232,4 +4232,7 @@ backtracking verbs. --/ |
|
| 902 |
- /(?<A>)(?J:(?<B>)(?<B>))(?<C>)/ |
|
| 903 |
- \O\CC |
|
| 904 |
- |
|
| 905 |
-+/(?=a\K)/ |
|
| 906 |
-+ ring bpattingbobnd $ 1,oern cou \rb\L |
|
| 907 |
-+ |
|
| 908 |
- /-- End of testinput2 --/ |
|
| 909 |
-diff --git a/testdata/testoutput2 b/testdata/testoutput2 |
|
| 910 |
-index ffb4466..5fb28d5 100644 |
|
| 911 |
-+++ b/testdata/testoutput2 |
|
| 912 |
-@@ -14644,4 +14644,10 @@ No match |
|
| 913 |
- Matched, but too many substrings |
|
| 914 |
- copy substring C failed -7 |
|
| 915 |
- |
|
| 916 |
-+/(?=a\K)/ |
|
| 917 |
-+ ring bpattingbobnd $ 1,oern cou \rb\L |
|
| 918 |
-+Start of matched string is beyond its end - displaying from end to start. |
|
| 919 |
-+ 0: a |
|
| 920 |
-+ 0L |
|
| 921 |
-+ |
|
| 922 |
- /-- End of testinput2 --/ |
|
| 923 |
-2.5.0 |
|
| 924 |
- |
|
| 925 |
-From 3da5528b47b88c32224cf9d14d8a4e80cd7a0815 Mon Sep 17 00:00:00 2001 |
|
| 926 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 927 |
-Date: Sat, 6 Feb 2016 16:54:14 +0000 |
|
| 928 |
-Subject: [PATCH] Fix pcretest bad behaviour for callout in lookbehind. |
|
| 929 |
-MIME-Version: 1.0 |
|
| 930 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 931 |
-Content-Transfer-Encoding: 8bit |
|
| 932 |
- |
|
| 933 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1625 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 934 |
- |
|
| 935 |
-Petr Písař: Ported to 8.38. |
|
| 936 |
- |
|
| 937 |
-diff --git a/pcretest.c b/pcretest.c |
|
| 938 |
-index 488e419..63869fd 100644 |
|
| 939 |
-+++ b/pcretest.c |
|
| 940 |
-@@ -2250,7 +2250,7 @@ data is not zero. */ |
|
| 941 |
- static int callout(pcre_callout_block *cb) |
|
| 942 |
- {
|
|
| 943 |
- FILE *f = (first_callout | callout_extra)? outfile : NULL; |
|
| 944 |
--int i, pre_start, post_start, subject_length; |
|
| 945 |
-+int i, current_position, pre_start, post_start, subject_length; |
|
| 946 |
- |
|
| 947 |
- if (callout_extra) |
|
| 948 |
- {
|
|
| 949 |
-@@ -2280,14 +2280,19 @@ printed lengths of the substrings. */ |
|
| 950 |
- |
|
| 951 |
- if (f != NULL) fprintf(f, "--->"); |
|
| 952 |
- |
|
| 953 |
-+/* If a lookbehind is involved, the current position may be earlier than the |
|
| 954 |
-+match start. If so, use the match start instead. */ |
|
| 955 |
-+ |
|
| 956 |
-+current_position = (cb->current_position >= cb->start_match)? |
|
| 957 |
-+ cb->current_position : cb->start_match; |
|
| 958 |
-+ |
|
| 959 |
- PCHARS(pre_start, cb->subject, 0, cb->start_match, f); |
|
| 960 |
- PCHARS(post_start, cb->subject, cb->start_match, |
|
| 961 |
-- cb->current_position - cb->start_match, f); |
|
| 962 |
-+ current_position - cb->start_match, f); |
|
| 963 |
- |
|
| 964 |
- PCHARS(subject_length, cb->subject, 0, cb->subject_length, NULL); |
|
| 965 |
- |
|
| 966 |
--PCHARSV(cb->subject, cb->current_position, |
|
| 967 |
-- cb->subject_length - cb->current_position, f); |
|
| 968 |
-+PCHARSV(cb->subject, current_position, cb->subject_length - current_position, f); |
|
| 969 |
- |
|
| 970 |
- if (f != NULL) fprintf(f, "\n"); |
|
| 971 |
- |
|
| 972 |
-@@ -5740,3 +5745,4 @@ return yield; |
|
| 973 |
- } |
|
| 974 |
- |
|
| 975 |
- /* End of pcretest.c */ |
|
| 976 |
-+ |
|
| 977 |
-diff --git a/testdata/testinput2 b/testdata/testinput2 |
|
| 978 |
-index 967a241..086e0f4 100644 |
|
| 979 |
-+++ b/testdata/testinput2 |
|
| 980 |
-@@ -4235,4 +4235,8 @@ backtracking verbs. --/ |
|
| 981 |
- /(?=a\K)/ |
|
| 982 |
- ring bpattingbobnd $ 1,oern cou \rb\L |
|
| 983 |
- |
|
| 984 |
-+/(?<=((?C)0))/ |
|
| 985 |
-+ 9010 |
|
| 986 |
-+ abcd |
|
| 987 |
-+ |
|
| 988 |
- /-- End of testinput2 --/ |
|
| 989 |
-diff --git a/testdata/testoutput2 b/testdata/testoutput2 |
|
| 990 |
-index 5fb28d5..d414a72 100644 |
|
| 991 |
-+++ b/testdata/testoutput2 |
|
| 992 |
-@@ -14650,4 +14650,19 @@ Start of matched string is beyond its end - displaying from end to start. |
|
| 993 |
- 0: a |
|
| 994 |
- 0L |
|
| 995 |
- |
|
| 996 |
-+/(?<=((?C)0))/ |
|
| 997 |
-+ 9010 |
|
| 998 |
-+--->9010 |
|
| 999 |
-+ 0 ^ 0 |
|
| 1000 |
-+ 0 ^ 0 |
|
| 1001 |
-+ 0: |
|
| 1002 |
-+ 1: 0 |
|
| 1003 |
-+ abcd |
|
| 1004 |
-+--->abcd |
|
| 1005 |
-+ 0 ^ 0 |
|
| 1006 |
-+ 0 ^ 0 |
|
| 1007 |
-+ 0 ^ 0 |
|
| 1008 |
-+ 0 ^ 0 |
|
| 1009 |
-+No match |
|
| 1010 |
-+ |
|
| 1011 |
- /-- End of testinput2 --/ |
|
| 1012 |
-2.5.0 |
|
| 1013 |
- |
|
| 1014 |
-From 943a5105b9fe2842851003f692c7077a6cdbeefe Mon Sep 17 00:00:00 2001 |
|
| 1015 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 1016 |
-Date: Wed, 10 Feb 2016 19:13:17 +0000 |
|
| 1017 |
-Subject: [PATCH] Fix workspace overflow for (*ACCEPT) with deeply nested |
|
| 1018 |
- parentheses. |
|
| 1019 |
-MIME-Version: 1.0 |
|
| 1020 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 1021 |
-Content-Transfer-Encoding: 8bit |
|
| 1022 |
- |
|
| 1023 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1631 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 1024 |
- |
|
| 1025 |
-Petr Písař: Ported to 8.38. |
|
| 1026 |
- |
|
| 1027 |
-diff --git a/pcre_compile.c b/pcre_compile.c |
|
| 1028 |
-index b9a239e..5019854 100644 |
|
| 1029 |
-+++ b/pcre_compile.c |
|
| 1030 |
-@@ -6,7 +6,7 @@ |
|
| 1031 |
- and semantics are as close as possible to those of the Perl 5 language. |
|
| 1032 |
- |
|
| 1033 |
- Written by Philip Hazel |
|
| 1034 |
-- Copyright (c) 1997-2014 University of Cambridge |
|
| 1035 |
-+ Copyright (c) 1997-2016 University of Cambridge |
|
| 1036 |
- |
|
| 1037 |
- ----------------------------------------------------------------------------- |
|
| 1038 |
- Redistribution and use in source and binary forms, with or without |
|
| 1039 |
-@@ -560,6 +560,7 @@ static const char error_texts[] = |
|
| 1040 |
- /* 85 */ |
|
| 1041 |
- "parentheses are too deeply nested (stack check)\0" |
|
| 1042 |
- "digits missing in \\x{} or \\o{}\0"
|
|
| 1043 |
-+ "regular expression is too complicated\0" |
|
| 1044 |
- ; |
|
| 1045 |
- |
|
| 1046 |
- /* Table to identify digits and hex digits. This is used when compiling |
|
| 1047 |
-@@ -4591,7 +4592,8 @@ for (;; ptr++) |
|
| 1048 |
- if (code > cd->start_workspace + cd->workspace_size - |
|
| 1049 |
- WORK_SIZE_SAFETY_MARGIN) /* Check for overrun */ |
|
| 1050 |
- {
|
|
| 1051 |
-- *errorcodeptr = ERR52; |
|
| 1052 |
-+ *errorcodeptr = (code >= cd->start_workspace + cd->workspace_size)? |
|
| 1053 |
-+ ERR52 : ERR87; |
|
| 1054 |
- goto FAILED; |
|
| 1055 |
- } |
|
| 1056 |
- |
|
| 1057 |
-@@ -6626,8 +6628,21 @@ for (;; ptr++) |
|
| 1058 |
- cd->had_accept = TRUE; |
|
| 1059 |
- for (oc = cd->open_caps; oc != NULL; oc = oc->next) |
|
| 1060 |
- {
|
|
| 1061 |
-- *code++ = OP_CLOSE; |
|
| 1062 |
-- PUT2INC(code, 0, oc->number); |
|
| 1063 |
-+ if (lengthptr != NULL) |
|
| 1064 |
-+ {
|
|
| 1065 |
-+#ifdef COMPILE_PCRE8 |
|
| 1066 |
-+ *lengthptr += 1 + IMM2_SIZE; |
|
| 1067 |
-+#elif defined COMPILE_PCRE16 |
|
| 1068 |
-+ *lengthptr += 2 + IMM2_SIZE; |
|
| 1069 |
-+#elif defined COMPILE_PCRE32 |
|
| 1070 |
-+ *lengthptr += 4 + IMM2_SIZE; |
|
| 1071 |
-+#endif |
|
| 1072 |
-+ } |
|
| 1073 |
-+ else |
|
| 1074 |
-+ {
|
|
| 1075 |
-+ *code++ = OP_CLOSE; |
|
| 1076 |
-+ PUT2INC(code, 0, oc->number); |
|
| 1077 |
-+ } |
|
| 1078 |
- } |
|
| 1079 |
- setverb = *code++ = |
|
| 1080 |
- (cd->assert_depth > 0)? OP_ASSERT_ACCEPT : OP_ACCEPT; |
|
| 1081 |
-diff --git a/pcre_internal.h b/pcre_internal.h |
|
| 1082 |
-index f7a5ee7..dbfe80e 100644 |
|
| 1083 |
-+++ b/pcre_internal.h |
|
| 1084 |
-@@ -7,7 +7,7 @@ |
|
| 1085 |
- and semantics are as close as possible to those of the Perl 5 language. |
|
| 1086 |
- |
|
| 1087 |
- Written by Philip Hazel |
|
| 1088 |
-- Copyright (c) 1997-2014 University of Cambridge |
|
| 1089 |
-+ Copyright (c) 1997-2016 University of Cambridge |
|
| 1090 |
- |
|
| 1091 |
- ----------------------------------------------------------------------------- |
|
| 1092 |
- Redistribution and use in source and binary forms, with or without |
|
| 1093 |
-@@ -2289,7 +2289,7 @@ enum { ERR0, ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9,
|
|
| 1094 |
- ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59, |
|
| 1095 |
- ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69, |
|
| 1096 |
- ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79, |
|
| 1097 |
-- ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERRCOUNT }; |
|
| 1098 |
-+ ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERR87, ERRCOUNT }; |
|
| 1099 |
- |
|
| 1100 |
- /* JIT compiling modes. The function list is indexed by them. */ |
|
| 1101 |
- |
|
| 1102 |
-diff --git a/pcreposix.c b/pcreposix.c |
|
| 1103 |
-index dcc13ef..55b6ddc 100644 |
|
| 1104 |
-+++ b/pcreposix.c |
|
| 1105 |
-@@ -6,7 +6,7 @@ |
|
| 1106 |
- and semantics are as close as possible to those of the Perl 5 language. |
|
| 1107 |
- |
|
| 1108 |
- Written by Philip Hazel |
|
| 1109 |
-- Copyright (c) 1997-2014 University of Cambridge |
|
| 1110 |
-+ Copyright (c) 1997-2016 University of Cambridge |
|
| 1111 |
- |
|
| 1112 |
- ----------------------------------------------------------------------------- |
|
| 1113 |
- Redistribution and use in source and binary forms, with or without |
|
| 1114 |
-@@ -173,7 +173,8 @@ static const int eint[] = {
|
|
| 1115 |
- REG_BADPAT, /* group name must start with a non-digit */ |
|
| 1116 |
- /* 85 */ |
|
| 1117 |
- REG_BADPAT, /* parentheses too deeply nested (stack check) */ |
|
| 1118 |
-- REG_BADPAT /* missing digits in \x{} or \o{} */
|
|
| 1119 |
-+ REG_BADPAT, /* missing digits in \x{} or \o{} */
|
|
| 1120 |
-+ REG_BADPAT /* pattern too complicated */ |
|
| 1121 |
- }; |
|
| 1122 |
- |
|
| 1123 |
- /* Table of texts corresponding to POSIX error codes */ |
|
| 1124 |
-diff --git a/testdata/testinput11 b/testdata/testinput11 |
|
| 1125 |
-index ac9d228..6f0989a 100644 |
|
| 1126 |
-+++ b/testdata/testinput11 |
|
| 1127 |
-@@ -138,4 +138,6 @@ is required for these tests. --/ |
|
| 1128 |
- |
|
| 1129 |
- /.((?2)(?R)\1)()/B |
|
| 1130 |
- |
|
| 1131 |
-+/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([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)/ |
|
| 1132 |
-+ |
|
| 1133 |
- /-- End of testinput11 --/ |
|
| 1134 |
-diff --git a/testdata/testoutput11-16 b/testdata/testoutput11-16 |
|
| 1135 |
-index 280692e..3c485da 100644 |
|
| 1136 |
-+++ b/testdata/testoutput11-16 |
|
| 1137 |
-@@ -765,4 +765,7 @@ Memory allocation (code space): 14 |
|
| 1138 |
- 25 End |
|
| 1139 |
- ------------------------------------------------------------------ |
|
| 1140 |
- |
|
| 1141 |
-+/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([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)/ |
|
| 1142 |
-+Failed: regular expression is too complicated at offset 490 |
|
| 1143 |
-+ |
|
| 1144 |
- /-- End of testinput11 --/ |
|
| 1145 |
-diff --git a/testdata/testoutput11-32 b/testdata/testoutput11-32 |
|
| 1146 |
-index cdbda74..e19518d 100644 |
|
| 1147 |
-+++ b/testdata/testoutput11-32 |
|
| 1148 |
-@@ -765,4 +765,7 @@ Memory allocation (code space): 28 |
|
| 1149 |
- 25 End |
|
| 1150 |
- ------------------------------------------------------------------ |
|
| 1151 |
- |
|
| 1152 |
-+/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([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)/ |
|
| 1153 |
-+Failed: missing ) at offset 509 |
|
| 1154 |
-+ |
|
| 1155 |
- /-- End of testinput11 --/ |
|
| 1156 |
-diff --git a/testdata/testoutput11-8 b/testdata/testoutput11-8 |
|
| 1157 |
-index cb37896..5a4fbb2 100644 |
|
| 1158 |
-+++ b/testdata/testoutput11-8 |
|
| 1159 |
-@@ -765,4 +765,7 @@ Memory allocation (code space): 10 |
|
| 1160 |
- 38 End |
|
| 1161 |
- ------------------------------------------------------------------ |
|
| 1162 |
- |
|
| 1163 |
-+/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([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)/ |
|
| 1164 |
-+Failed: missing ) at offset 509 |
|
| 1165 |
-+ |
|
| 1166 |
- /-- End of testinput11 --/ |
|
| 1167 |
-2.5.0 |
|
| 1168 |
- |
|
| 1169 |
-From b7537308b7c758f33c347cb0bec62754c43c271f Mon Sep 17 00:00:00 2001 |
|
| 1170 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 1171 |
-Date: Sat, 27 Feb 2016 17:38:11 +0000 |
|
| 1172 |
-Subject: [PATCH] Yet another duplicate name bugfix by overestimating the |
|
| 1173 |
- memory needed (i.e. another hack - PCRE2 has this "properly" fixed). |
|
| 1174 |
-MIME-Version: 1.0 |
|
| 1175 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 1176 |
-Content-Transfer-Encoding: 8bit |
|
| 1177 |
- |
|
| 1178 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1636 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 1179 |
- |
|
| 1180 |
-Petr Písař: Ported to 8.38. |
|
| 1181 |
- |
|
| 1182 |
-diff --git a/pcre_compile.c b/pcre_compile.c |
|
| 1183 |
-index 5019854..4ffea0c 100644 |
|
| 1184 |
-+++ b/pcre_compile.c |
|
| 1185 |
-@@ -7311,7 +7311,12 @@ for (;; ptr++) |
|
| 1186 |
- so far in order to get the number. If the name is not found, leave |
|
| 1187 |
- the value of recno as 0 for a forward reference. */ |
|
| 1188 |
- |
|
| 1189 |
-- else |
|
| 1190 |
-+ /* This patch (removing "else") fixes a problem when a reference is |
|
| 1191 |
-+ to multiple identically named nested groups from within the nest. |
|
| 1192 |
-+ Once again, it is not the "proper" fix, and it results in an |
|
| 1193 |
-+ over-allocation of memory. */ |
|
| 1194 |
-+ |
|
| 1195 |
-+ /* else */ |
|
| 1196 |
- {
|
|
| 1197 |
- ng = cd->named_groups; |
|
| 1198 |
- for (i = 0; i < cd->names_found; i++, ng++) |
|
| 1199 |
-diff --git a/testdata/testinput2 b/testdata/testinput2 |
|
| 1200 |
-index 086e0f4..c805f5f 100644 |
|
| 1201 |
-+++ b/testdata/testinput2 |
|
| 1202 |
-@@ -4239,4 +4239,6 @@ backtracking verbs. --/ |
|
| 1203 |
- 9010 |
|
| 1204 |
- abcd |
|
| 1205 |
- |
|
| 1206 |
-+/((?J)(?'R'(?'R'(?'R'(?'R'(?'R'(?|(\k'R'))))))))/ |
|
| 1207 |
-+ |
|
| 1208 |
- /-- End of testinput2 --/ |
|
| 1209 |
-diff --git a/testdata/testoutput2 b/testdata/testoutput2 |
|
| 1210 |
-index d414a72..800a72f 100644 |
|
| 1211 |
-+++ b/testdata/testoutput2 |
|
| 1212 |
-@@ -14665,4 +14665,6 @@ Start of matched string is beyond its end - displaying from end to start. |
|
| 1213 |
- 0 ^ 0 |
|
| 1214 |
- No match |
|
| 1215 |
- |
|
| 1216 |
-+/((?J)(?'R'(?'R'(?'R'(?'R'(?'R'(?|(\k'R'))))))))/ |
|
| 1217 |
-+ |
|
| 1218 |
- /-- End of testinput2 --/ |
|
| 1219 |
-2.5.0 |
|
| 1220 |
- |
|
| 1221 |
-From 0fc2edb79b3815c6511fd75c36a57893e4acaee6 Mon Sep 17 00:00:00 2001 |
|
| 1222 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 1223 |
-Date: Sat, 27 Feb 2016 17:55:24 +0000 |
|
| 1224 |
-Subject: [PATCH] Fix pcretest loop for global matching with an ovector size |
|
| 1225 |
- less than 2. |
|
| 1226 |
-MIME-Version: 1.0 |
|
| 1227 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 1228 |
-Content-Transfer-Encoding: 8bit |
|
| 1229 |
- |
|
| 1230 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1637 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 1231 |
- |
|
| 1232 |
-Petr Písař: Ported to 8.38. |
|
| 1233 |
- |
|
| 1234 |
-diff --git a/pcretest.c b/pcretest.c |
|
| 1235 |
-index 63869fd..78ef517 100644 |
|
| 1236 |
-+++ b/pcretest.c |
|
| 1237 |
-@@ -5617,6 +5617,12 @@ while (!done) |
|
| 1238 |
- break; |
|
| 1239 |
- } |
|
| 1240 |
- |
|
| 1241 |
-+ if (use_size_offsets < 2) |
|
| 1242 |
-+ {
|
|
| 1243 |
-+ fprintf(outfile, "Cannot do global matching with an ovector size < 2\n"); |
|
| 1244 |
-+ break; |
|
| 1245 |
-+ } |
|
| 1246 |
-+ |
|
| 1247 |
- /* If we have matched an empty string, first check to see if we are at |
|
| 1248 |
- the end of the subject. If so, the /g loop is over. Otherwise, mimic what |
|
| 1249 |
- Perl's /g options does. This turns out to be rather cunning. First we set |
|
| 1250 |
-2.5.0 |
|
| 1251 |
- |
|
| 1252 |
-From b3db1b7de5cfaa026ec2bc4a393129461a0f5c57 Mon Sep 17 00:00:00 2001 |
|
| 1253 |
-From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> |
|
| 1254 |
-Date: Sat, 27 Feb 2016 18:44:41 +0000 |
|
| 1255 |
-Subject: [PATCH] Fix non-diagnosis of missing assertion after (?(?C). |
|
| 1256 |
-MIME-Version: 1.0 |
|
| 1257 |
-Content-Type: text/plain; charset=UTF-8 |
|
| 1258 |
-Content-Transfer-Encoding: 8bit |
|
| 1259 |
- |
|
| 1260 |
-git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1638 2f5784b3-3f2a-0410-8824-cb99058d5e15 |
|
| 1261 |
- |
|
| 1262 |
-Petr Písař: Ported to 8.38. |
|
| 1263 |
- |
|
| 1264 |
-diff --git a/pcre_compile.c b/pcre_compile.c |
|
| 1265 |
-index 4ffea0c..254c629 100644 |
|
| 1266 |
-+++ b/pcre_compile.c |
|
| 1267 |
-@@ -485,7 +485,7 @@ static const char error_texts[] = |
|
| 1268 |
- "lookbehind assertion is not fixed length\0" |
|
| 1269 |
- "malformed number or name after (?(\0" |
|
| 1270 |
- "conditional group contains more than two branches\0" |
|
| 1271 |
-- "assertion expected after (?(\0" |
|
| 1272 |
-+ "assertion expected after (?( or (?(?C)\0" |
|
| 1273 |
- "(?R or (?[+-]digits must be followed by )\0" |
|
| 1274 |
- /* 30 */ |
|
| 1275 |
- "unknown POSIX class name\0" |
|
| 1276 |
-@@ -6771,6 +6771,15 @@ for (;; ptr++) |
|
| 1277 |
- for (i = 3;; i++) if (!IS_DIGIT(ptr[i])) break; |
|
| 1278 |
- if (ptr[i] == CHAR_RIGHT_PARENTHESIS) |
|
| 1279 |
- tempptr += i + 1; |
|
| 1280 |
-+ |
|
| 1281 |
-+ /* tempptr should now be pointing to the opening parenthesis of the |
|
| 1282 |
-+ assertion condition. */ |
|
| 1283 |
-+ |
|
| 1284 |
-+ if (*tempptr != CHAR_LEFT_PARENTHESIS) |
|
| 1285 |
-+ {
|
|
| 1286 |
-+ *errorcodeptr = ERR28; |
|
| 1287 |
-+ goto FAILED; |
|
| 1288 |
-+ } |
|
| 1289 |
- } |
|
| 1290 |
- |
|
| 1291 |
- /* For conditions that are assertions, check the syntax, and then exit |
|
| 1292 |
-diff --git a/testdata/testinput2 b/testdata/testinput2 |
|
| 1293 |
-index c805f5f..75e402e 100644 |
|
| 1294 |
-+++ b/testdata/testinput2 |
|
| 1295 |
-@@ -4241,4 +4241,6 @@ backtracking verbs. --/ |
|
| 1296 |
- |
|
| 1297 |
- /((?J)(?'R'(?'R'(?'R'(?'R'(?'R'(?|(\k'R'))))))))/ |
|
| 1298 |
- |
|
| 1299 |
-+/\N(?(?C)0?!.)*/ |
|
| 1300 |
-+ |
|
| 1301 |
- /-- End of testinput2 --/ |
|
| 1302 |
-diff --git a/testdata/testoutput2 b/testdata/testoutput2 |
|
| 1303 |
-index 800a72f..5e88d1a 100644 |
|
| 1304 |
-+++ b/testdata/testoutput2 |
|
| 1305 |
-@@ -555,13 +555,13 @@ Failed: malformed number or name after (?( at offset 4 |
|
| 1306 |
- Failed: malformed number or name after (?( at offset 4 |
|
| 1307 |
- |
|
| 1308 |
- /(?(?i))/ |
|
| 1309 |
--Failed: assertion expected after (?( at offset 3 |
|
| 1310 |
-+Failed: assertion expected after (?( or (?(?C) at offset 3 |
|
| 1311 |
- |
|
| 1312 |
- /(?(abc))/ |
|
| 1313 |
- Failed: reference to non-existent subpattern at offset 7 |
|
| 1314 |
- |
|
| 1315 |
- /(?(?<ab))/ |
|
| 1316 |
--Failed: assertion expected after (?( at offset 3 |
|
| 1317 |
-+Failed: assertion expected after (?( or (?(?C) at offset 3 |
|
| 1318 |
- |
|
| 1319 |
- /((?s)blah)\s+\1/I |
|
| 1320 |
- Capturing subpattern count = 1 |
|
| 1321 |
-@@ -7870,7 +7870,7 @@ No match |
|
| 1322 |
- Failed: malformed number or name after (?( at offset 6 |
|
| 1323 |
- |
|
| 1324 |
- /(?(''))/
|
|
| 1325 |
--Failed: assertion expected after (?( at offset 4 |
|
| 1326 |
-+Failed: assertion expected after (?( or (?(?C) at offset 4 |
|
| 1327 |
- |
|
| 1328 |
- /(?('R')stuff)/
|
|
| 1329 |
- Failed: reference to non-existent subpattern at offset 7 |
|
| 1330 |
-@@ -14346,7 +14346,7 @@ No match |
|
| 1331 |
- "((?2)+)((?1))" |
|
| 1332 |
- |
|
| 1333 |
- "(?(?<E>.*!.*)?)" |
|
| 1334 |
--Failed: assertion expected after (?( at offset 3 |
|
| 1335 |
-+Failed: assertion expected after (?( or (?(?C) at offset 3 |
|
| 1336 |
- |
|
| 1337 |
- "X((?2)()*+){2}+"BZ
|
|
| 1338 |
- ------------------------------------------------------------------ |
|
| 1339 |
-@@ -14667,4 +14667,7 @@ No match |
|
| 1340 |
- |
|
| 1341 |
- /((?J)(?'R'(?'R'(?'R'(?'R'(?'R'(?|(\k'R'))))))))/ |
|
| 1342 |
- |
|
| 1343 |
-+/\N(?(?C)0?!.)*/ |
|
| 1344 |
-+Failed: assertion expected after (?( or (?(?C) at offset 4 |
|
| 1345 |
-+ |
|
| 1346 |
- /-- End of testinput2 --/ |
|
| 1347 |
-2.5.0 |
|
| 1348 |
- |
| ... | ... |
@@ -1,37 +1,35 @@ |
| 1 |
-Summary: Grep for perl compatible regular expressions |
|
| 2 |
-Name: pcre |
|
| 3 |
-Version: 8.38 |
|
| 4 |
-Release: 3%{?dist}
|
|
| 5 |
-License: BSD |
|
| 6 |
-URL: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.bz2 |
|
| 7 |
-Group: Applications/System |
|
| 8 |
-Vendor: VMware, Inc. |
|
| 9 |
-Distribution: Photon |
|
| 10 |
-Source0: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/%{name}-%{version}.tar.bz2
|
|
| 11 |
-%define sha1 pcre=ae84e3b3ef0764788ce33b1adeff1add938126e1 |
|
| 12 |
-Patch0: pcre-8.38-upstream_fixes-1.patch |
|
| 13 |
-BuildRequires: bzip2-devel |
|
| 14 |
-BuildRequires: readline-devel |
|
| 1 |
+Summary: Grep for perl compatible regular expressions |
|
| 2 |
+Name: pcre |
|
| 3 |
+Version: 8.39 |
|
| 4 |
+Release: 1%{?dist}
|
|
| 5 |
+License: BSD |
|
| 6 |
+URL: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.bz2 |
|
| 7 |
+Group: Applications/System |
|
| 8 |
+Vendor: VMware, Inc. |
|
| 9 |
+Distribution: Photon |
|
| 10 |
+Source0: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/%{name}-%{version}.tar.bz2
|
|
| 11 |
+%define sha1 pcre=5e38289fd1b4ef3e8426f31a01e34b6924d80b90 |
|
| 12 |
+BuildRequires: bzip2-devel |
|
| 13 |
+BuildRequires: readline-devel |
|
| 15 | 14 |
Requires: libgcc |
| 16 | 15 |
Requires: libstdc++ |
| 17 | 16 |
%description |
| 18 | 17 |
The PCRE package contains Perl Compatible Regular Expression libraries. These are useful for implementing regular expression pattern matching using the same syntax and semantics as Perl 5. |
| 19 | 18 |
|
| 20 |
-%package devel |
|
| 19 |
+%package devel |
|
| 21 | 20 |
Group: Development/Libraries |
| 22 | 21 |
Summary: Headers and static lib for pcre development |
| 23 |
-Requires: %{name} = %{version}
|
|
| 24 |
-Provides: pkgconfig(libpcre) |
|
| 25 |
-%description devel |
|
| 22 |
+Requires: %{name} = %{version}
|
|
| 23 |
+Provides: pkgconfig(libpcre) |
|
| 24 |
+%description devel |
|
| 26 | 25 |
Install this package if you want do compile applications using the pcre |
| 27 | 26 |
library. |
| 28 | 27 |
|
| 29 | 28 |
%prep |
| 30 | 29 |
%setup -q |
| 31 |
-%patch0 -p1 |
|
| 32 | 30 |
%build |
| 33 | 31 |
./configure --prefix=/usr \ |
| 34 |
- --docdir=/usr/share/doc/pcre-8.38 \ |
|
| 32 |
+ --docdir=/usr/share/doc/pcre-8.39 \ |
|
| 35 | 33 |
--enable-unicode-properties \ |
| 36 | 34 |
--enable-pcre16 \ |
| 37 | 35 |
--enable-pcre32 \ |
| ... | ... |
@@ -45,8 +43,8 @@ make DESTDIR=%{buildroot} install
|
| 45 | 45 |
mv -v %{buildroot}/usr/lib/libpcre.so.* %{buildroot}/lib &&
|
| 46 | 46 |
ln -sfv ../../lib/$(readlink %{buildroot}/usr/lib/libpcre.so) %{buildroot}/usr/lib/libpcre.so
|
| 47 | 47 |
ln -sfv $(readlink %{buildroot}/usr/lib/libpcre.so) %{buildroot}/usr/lib/libpcre.so.0
|
| 48 |
-%post -p /sbin/ldconfig |
|
| 49 |
-%postun -p /sbin/ldconfig |
|
| 48 |
+%post -p /sbin/ldconfig |
|
| 49 |
+%postun -p /sbin/ldconfig |
|
| 50 | 50 |
%files |
| 51 | 51 |
%defattr(-,root,root) |
| 52 | 52 |
%{_bindir}/pcregrep
|
| ... | ... |
@@ -67,13 +65,15 @@ ln -sfv $(readlink %{buildroot}/usr/lib/libpcre.so) %{buildroot}/usr/lib/libpcre
|
| 67 | 67 |
%{_libdir}/pkgconfig/*.pc
|
| 68 | 68 |
%{_includedir}/*
|
| 69 | 69 |
%changelog |
| 70 |
-* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 8.38-3 |
|
| 71 |
-- GA - Bump release of all rpms |
|
| 72 |
-* Fri Mar 18 2016 Anish Swaminathan <anishs@vmware.com> 8.38-2 |
|
| 73 |
-- Add upstream fixes patch |
|
| 74 |
-* Thu Jan 21 2016 Xiaolin Li <xiaolinl@vmware.com> 8.38-1 |
|
| 75 |
-- Updated to version 8.38 |
|
| 76 |
-* Mon Nov 30 2015 Sharath George <sharathg@vmware.com> 8.36-2 |
|
| 77 |
- Add symlink for libpcre.so.1 |
|
| 78 |
-* Thu Nov 06 2014 Sharath George <sharathg@vmware.com> 8.36-1 |
|
| 79 |
- Initial version |
|
| 70 |
+* Fri Sep 9 2016 Xiaolin Li <xiaolinl@vmware.com> 8.39-1 |
|
| 71 |
+- Update to version 8.39 |
|
| 72 |
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 8.38-3 |
|
| 73 |
+- GA - Bump release of all rpms |
|
| 74 |
+* Fri Mar 18 2016 Anish Swaminathan <anishs@vmware.com> 8.38-2 |
|
| 75 |
+- Add upstream fixes patch |
|
| 76 |
+* Thu Jan 21 2016 Xiaolin Li <xiaolinl@vmware.com> 8.38-1 |
|
| 77 |
+- Updated to version 8.38 |
|
| 78 |
+* Mon Nov 30 2015 Sharath George <sharathg@vmware.com> 8.36-2 |
|
| 79 |
+ Add symlink for libpcre.so.1 |
|
| 80 |
+* Thu Nov 06 2014 Sharath George <sharathg@vmware.com> 8.36-1 |
|
| 81 |
+ Initial version |