From b53574bf91a1304f1b2476c0ec731356cd1fe773 Mon Sep 17 00:00:00 2001 From: Matthew Vernon Date: Tue, 2 Aug 2016 18:56:54 +0100 Subject: [PATCH] Revert "Apply upstream revision 489 (Closes: #815920)" This reverts commit 6e2f9220620fa8f0f3a3ef62d940b9fcd4cedea3. We do this as the new upstream version has fixed the bug this fixes. --- src/pcre2_compile.c | 16 ++-------------- testdata/testinput8 | 2 -- testdata/testoutput8-16-2 | 3 --- testdata/testoutput8-16-3 | 3 --- testdata/testoutput8-32-2 | 3 --- testdata/testoutput8-32-3 | 3 --- testdata/testoutput8-32-4 | 3 --- testdata/testoutput8-8-2 | 3 --- testdata/testoutput8-8-3 | 3 --- testdata/testoutput8-8-4 | 3 --- 10 files changed, 2 insertions(+), 40 deletions(-) diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c index 4010d17..d852837 100644 --- a/src/pcre2_compile.c +++ b/src/pcre2_compile.c @@ -5899,22 +5899,10 @@ for (;; ptr++) goto FAILED; } cb->had_accept = TRUE; - - /* In the first pass, just accumulate the length required; - otherwise hitting (*ACCEPT) inside many nested parentheses can - cause workspace overflow. */ - for (oc = cb->open_caps; oc != NULL; oc = oc->next) { - if (lengthptr != NULL) - { - *lengthptr += CU2BYTES(1) + IMM2_SIZE; - } - else - { - *code++ = OP_CLOSE; - PUT2INC(code, 0, oc->number); - } + *code++ = OP_CLOSE; + PUT2INC(code, 0, oc->number); } setverb = *code++ = (cb->assert_depth > 0)? OP_ASSERT_ACCEPT : OP_ACCEPT; diff --git a/testdata/testinput8 b/testdata/testinput8 index 7e2a1f0..ca3b1b9 100644 --- a/testdata/testinput8 +++ b/testdata/testinput8 @@ -182,6 +182,4 @@ /((?1)(?2)(?3)(?4)(?5)(?6)(?7)(?8)(?9)(?9)(?8)(?7)(?6)(?5)(?4)(?3)(?2)(?1)(?0)){2,}()()()()()()()()()/debug -/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([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)/ - # End of testinput8 diff --git a/testdata/testoutput8-16-2 b/testdata/testoutput8-16-2 index a5e8dec..05669bb 100644 --- a/testdata/testoutput8-16-2 +++ b/testdata/testoutput8-16-2 @@ -1027,7 +1027,4 @@ Capturing subpattern count = 10 May match empty string Subject length lower bound = 0 -/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([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)/ -Failed: error 186 at offset 490: regular expression is too complicated - # End of testinput8 diff --git a/testdata/testoutput8-16-3 b/testdata/testoutput8-16-3 index 36133b3..31884e1 100644 --- a/testdata/testoutput8-16-3 +++ b/testdata/testoutput8-16-3 @@ -1023,7 +1023,4 @@ Capturing subpattern count = 10 May match empty string Subject length lower bound = 0 -/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([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)/ -Failed: error 114 at offset 509: missing closing parenthesis - # End of testinput8 diff --git a/testdata/testoutput8-32-2 b/testdata/testoutput8-32-2 index 99c4fad..babd0c7 100644 --- a/testdata/testoutput8-32-2 +++ b/testdata/testoutput8-32-2 @@ -1023,7 +1023,4 @@ Capturing subpattern count = 10 May match empty string Subject length lower bound = 0 -/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([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)/ -Failed: error 114 at offset 509: missing closing parenthesis - # End of testinput8 diff --git a/testdata/testoutput8-32-3 b/testdata/testoutput8-32-3 index 99c4fad..babd0c7 100644 --- a/testdata/testoutput8-32-3 +++ b/testdata/testoutput8-32-3 @@ -1023,7 +1023,4 @@ Capturing subpattern count = 10 May match empty string Subject length lower bound = 0 -/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([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)/ -Failed: error 114 at offset 509: missing closing parenthesis - # End of testinput8 diff --git a/testdata/testoutput8-32-4 b/testdata/testoutput8-32-4 index 99c4fad..babd0c7 100644 --- a/testdata/testoutput8-32-4 +++ b/testdata/testoutput8-32-4 @@ -1023,7 +1023,4 @@ Capturing subpattern count = 10 May match empty string Subject length lower bound = 0 -/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([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)/ -Failed: error 114 at offset 509: missing closing parenthesis - # End of testinput8 diff --git a/testdata/testoutput8-8-2 b/testdata/testoutput8-8-2 index 6dc1f42..6a9aa0a 100644 --- a/testdata/testoutput8-8-2 +++ b/testdata/testoutput8-8-2 @@ -1026,7 +1026,4 @@ Capturing subpattern count = 10 May match empty string Subject length lower bound = 0 -/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([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)/ -Failed: error 114 at offset 509: missing closing parenthesis - # End of testinput8 diff --git a/testdata/testoutput8-8-3 b/testdata/testoutput8-8-3 index ae14946..2fe1168 100644 --- a/testdata/testoutput8-8-3 +++ b/testdata/testoutput8-8-3 @@ -1024,7 +1024,4 @@ Capturing subpattern count = 10 May match empty string Subject length lower bound = 0 -/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([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)/ -Failed: error 114 at offset 509: missing closing parenthesis - # End of testinput8 diff --git a/testdata/testoutput8-8-4 b/testdata/testoutput8-8-4 index 6c79956..91993b2 100644 --- a/testdata/testoutput8-8-4 +++ b/testdata/testoutput8-8-4 @@ -1022,7 +1022,4 @@ Capturing subpattern count = 10 May match empty string Subject length lower bound = 0 -/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([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)/ -Failed: error 114 at offset 509: missing closing parenthesis - # End of testinput8 -- 2.30.2