summaryrefslogtreecommitdiffstats
path: root/patches/source
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2022-09-01 20:01:13 +0000
committer Eric Hameleers <alien@slackware.com>2022-09-02 13:30:06 +0200
commitca8c1d3c22e72e640980d5320ce89b31a0061a9b (patch)
tree03f08e8185bb4ac9ac4d68cde65b95f78ccc7887 /patches/source
parent1393bd0f4f5d765b7bb00c2f6b3fe98646133af9 (diff)
downloadcurrent-ca8c1d3c22e72e640980d5320ce89b31a0061a9b.tar.gz
current-ca8c1d3c22e72e640980d5320ce89b31a0061a9b.tar.xz
Thu Sep 1 20:01:13 UTC 202220220901200113_15.0
patches/packages/poppler-21.12.0-x86_64-2_slack15.0.txz: Rebuilt. [PATCH] JBIG2Stream: Fix crash on broken file. For more information, see: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-30860 (* Security fix *)
Diffstat (limited to 'patches/source')
-rw-r--r--patches/source/poppler/27354e9d9696ee2bc063910a6c9a6b27c5184a52.patch29
-rwxr-xr-xpatches/source/poppler/poppler.SlackBuild147
-rw-r--r--patches/source/poppler/slack-desc19
3 files changed, 195 insertions, 0 deletions
diff --git a/patches/source/poppler/27354e9d9696ee2bc063910a6c9a6b27c5184a52.patch b/patches/source/poppler/27354e9d9696ee2bc063910a6c9a6b27c5184a52.patch
new file mode 100644
index 000000000..a4ee928c5
--- /dev/null
+++ b/patches/source/poppler/27354e9d9696ee2bc063910a6c9a6b27c5184a52.patch
@@ -0,0 +1,29 @@
+From 27354e9d9696ee2bc063910a6c9a6b27c5184a52 Mon Sep 17 00:00:00 2001
+From: Albert Astals Cid <aacid@kde.org>
+Date: Thu, 25 Aug 2022 00:14:22 +0200
+Subject: [PATCH] JBIG2Stream: Fix crash on broken file
+
+https://github.com/jeffssh/CVE-2021-30860
+
+Thanks to David Warren for the heads up
+---
+ poppler/JBIG2Stream.cc | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
+index 662276e5..9f70431d 100644
+--- a/poppler/JBIG2Stream.cc
++++ b/poppler/JBIG2Stream.cc
+@@ -1976,7 +1976,11 @@ void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm, bool lossless
+ for (i = 0; i < nRefSegs; ++i) {
+ if ((seg = findSegment(refSegs[i]))) {
+ if (seg->getType() == jbig2SegSymbolDict) {
+- numSyms += ((JBIG2SymbolDict *)seg)->getSize();
++ const unsigned int segSize = ((JBIG2SymbolDict *)seg)->getSize();
++ if (unlikely(checkedAdd(numSyms, segSize, &numSyms))) {
++ error(errSyntaxError, getPos(), "Too many symbols in JBIG2 text region");
++ return;
++ }
+ } else if (seg->getType() == jbig2SegCodeTable) {
+ codeTables.push_back(seg);
+ }
diff --git a/patches/source/poppler/poppler.SlackBuild b/patches/source/poppler/poppler.SlackBuild
new file mode 100755
index 000000000..12a34ac3e
--- /dev/null
+++ b/patches/source/poppler/poppler.SlackBuild
@@ -0,0 +1,147 @@
+#!/bin/bash
+
+# Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2017, 2018, 2020 Patrick J. Volkerding, Sebeka, MN, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=poppler
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-2_slack15.0}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i586 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
+NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-${PKGNAM}
+rm -rf $PKG
+mkdir -p $TMP $PKG
+
+cd $TMP || exit 1
+rm -rf ${PKGNAM}-${VERSION}
+tar xvf $CWD/${PKGNAM}-$VERSION.tar.?z* || exit 1
+cd ${PKGNAM}-$VERSION || exit 1
+
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \+ -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \+
+
+# Fix CVE-2021-30860:
+zcat $CWD/27354e9d9696ee2bc063910a6c9a6b27c5184a52.patch.gz | patch -p1 --verbose || exit 1
+
+mkdir cmake-build
+cd cmake-build
+
+CXXFLAGS="$SLKCFLAGS -std=c++11 -fpermissive" \
+cmake \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_MANDIR=/usr/man \
+ -DBUILD_SHARED_LIBS=ON \
+ -DENABLE_QT5=ON \
+ -DENABLE_XPDF_HEADERS=ON \
+ -DENABLE_CMS=lcms2 \
+ -DENABLE_DCTDECODER=libjpeg \
+ -DENABLE_GTK_DOC=ON \
+ -DENABLE_LIBOPENJPEG=openjpeg2 \
+ -DENABLE_XPDF_HEADERS=ON \
+ -DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
+ -DENABLE_ZLIB=ON \
+ .. || exit 1
+
+make $NUMJOBS || make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+# Back to source tarball root directory:
+cd ..
+
+# Remove files that overlap with the xpdf package:
+rm -f $PKG/usr/bin/pdfdetach $PKG/usr/man/man1/pdfdetach.1
+
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+# Compress and link manpages, if any:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.?
+ )
+ done
+ )
+fi
+
+mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
+cp -a AUTHORS COPYING* INSTALL NEWS README* TODO \
+ $PKG/usr/doc/${PKGNAM}-$VERSION
+( cd $PKG/usr/doc/${PKGNAM}-$VERSION
+ ln -s /usr/share/gtk-doc/html/poppler html )
+
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
diff --git a/patches/source/poppler/slack-desc b/patches/source/poppler/slack-desc
new file mode 100644
index 000000000..baba4a307
--- /dev/null
+++ b/patches/source/poppler/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+poppler: poppler (a library for rendering PDF documents)
+poppler:
+poppler: Poppler is a library based on the xpdf PDF viewer developed by Derek
+poppler: Noonburg of Glyph and Cog, LLC. Since xpdf does not provide a shared
+poppler: library, whenever a flaw was found potentially dozens of applications
+poppler: incorporating code from xpdf would have to be patched. By providing
+poppler: a centralized PDF library this duplicated effort will be eliminated.
+poppler:
+poppler: Homepage: http://poppler.freedesktop.org
+poppler:
+poppler: