summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2014-11-21 15:30:01 +0100
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2014-11-21 16:48:32 +0100
commit800f832201267bcbf6a7e9b4b9dbc69f9029dcc0 (patch)
tree4d84abc9ccf976de99cb1fcb7ae9c5d6be292287 /src
parentc9c40af130763d81531ebee35d22d3b5573f48ef (diff)
Apply r1513 to our PCRE bundled copy
Fixes CVE-2014-8964. Upstream diff: http://www.exim.org/viewvc/pcre?view=revision&revision=1513 Change-Id: I59dc1f4c290e29ab5f22ed68eaeba702f4232e0e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/pcre/patches/pcre-r1513.patch18
-rw-r--r--src/3rdparty/pcre/pcre_exec.c7
2 files changed, 23 insertions, 2 deletions
diff --git a/src/3rdparty/pcre/patches/pcre-r1513.patch b/src/3rdparty/pcre/patches/pcre-r1513.patch
new file mode 100644
index 0000000000..d84aa0cc61
--- /dev/null
+++ b/src/3rdparty/pcre/patches/pcre-r1513.patch
@@ -0,0 +1,18 @@
+Index: pcre_exec.c
+===================================================================
+--- pcre_exec.c (revisione 1512)
++++ pcre_exec.c (revisione 1513)
+@@ -1404,8 +1404,11 @@
+ condition = TRUE;
+
+ /* Advance ecode past the assertion to the start of the first branch,
+- but adjust it so that the general choosing code below works. */
+-
++ but adjust it so that the general choosing code below works. If the
++ assertion has a quantifier that allows zero repeats we must skip over
++ the BRAZERO. This is a lunatic thing to do, but somebody did! */
++
++ if (*ecode == OP_BRAZERO) ecode++;
+ ecode += GET(ecode, 1);
+ while (*ecode == OP_ALT) ecode += GET(ecode, 1);
+ ecode += 1 + LINK_SIZE - PRIV(OP_lengths)[condcode];
diff --git a/src/3rdparty/pcre/pcre_exec.c b/src/3rdparty/pcre/pcre_exec.c
index b0101da351..7755aaf13a 100644
--- a/src/3rdparty/pcre/pcre_exec.c
+++ b/src/3rdparty/pcre/pcre_exec.c
@@ -1394,8 +1394,11 @@ for (;;)
condition = TRUE;
/* Advance ecode past the assertion to the start of the first branch,
- but adjust it so that the general choosing code below works. */
-
+ but adjust it so that the general choosing code below works. If the
+ assertion has a quantifier that allows zero repeats we must skip over
+ the BRAZERO. This is a lunatic thing to do, but somebody did! */
+
+ if (*ecode == OP_BRAZERO) ecode++;
ecode += GET(ecode, 1);
while (*ecode == OP_ALT) ecode += GET(ecode, 1);
ecode += 1 + LINK_SIZE - PRIV(OP_lengths)[condcode];