summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrien Nader <adrien@notk.org>2015-04-08 23:13:01 +0200
committerAdrien Nader <adrien@notk.org>2015-04-08 23:13:54 +0200
commit820655b547da94df368724cd98fe10b32c9d93e4 (patch)
tree0181e40031c58a6c31d22d1e76cba3bfd7da29f9
parent8a339535214f7c7073c88428018951e6a4a3a924 (diff)
pcre: patch for CVE-2014-8964.adrien/1.51.5
-rw-r--r--l/pcre/CVE-2014-8964-fix-zero-repeated-assertion-as-condition-bug.patch16
-rwxr-xr-xl/pcre/pcre.SlackBuild4
2 files changed, 20 insertions, 0 deletions
diff --git a/l/pcre/CVE-2014-8964-fix-zero-repeated-assertion-as-condition-bug.patch b/l/pcre/CVE-2014-8964-fix-zero-repeated-assertion-as-condition-bug.patch
new file mode 100644
index 0000000..dde0d28
--- /dev/null
+++ b/l/pcre/CVE-2014-8964-fix-zero-repeated-assertion-as-condition-bug.patch
@@ -0,0 +1,16 @@
+--- pcre_exec.c (revision 1512)
++++ pcre_exec.c (working copy)
+@@ -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/l/pcre/pcre.SlackBuild b/l/pcre/pcre.SlackBuild
index 976d7c9..d9fc407 100755
--- a/l/pcre/pcre.SlackBuild
+++ b/l/pcre/pcre.SlackBuild
@@ -41,6 +41,8 @@ CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-pcre
+set -e
+
rm -rf $PKG
mkdir -p $TMP $PKG
@@ -57,6 +59,8 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+patch -p0 --verbose < $CWD/CVE-2014-8964-fix-zero-repeated-assertion-as-condition-bug.patch
+
CFLAGS="-O2" \
LDFLAGS="-L/${PREFIX}/lib${LIBDIRSUFFIX}" \
./configure \