summaryrefslogtreecommitdiffstats
path: root/patches/source/libsoup
diff options
context:
space:
mode:
Diffstat (limited to 'patches/source/libsoup')
-rw-r--r--patches/source/libsoup/libsoup.CVE-2017-2885.diff43
-rwxr-xr-xpatches/source/libsoup/libsoup.SlackBuild100
-rw-r--r--patches/source/libsoup/slack-desc19
3 files changed, 162 insertions, 0 deletions
diff --git a/patches/source/libsoup/libsoup.CVE-2017-2885.diff b/patches/source/libsoup/libsoup.CVE-2017-2885.diff
new file mode 100644
index 00000000..e0c318a2
--- /dev/null
+++ b/patches/source/libsoup/libsoup.CVE-2017-2885.diff
@@ -0,0 +1,43 @@
+--- libsoup-2.58.1/libsoup/soup-filter-input-stream.c 2016-12-03 08:59:41.000000000 -0600
++++ libsoup-2.58.2/libsoup/soup-filter-input-stream.c 2017-08-10 07:06:09.000000000 -0500
+@@ -198,7 +198,7 @@
+ GCancellable *cancellable,
+ GError **error)
+ {
+- gssize nread;
++ gssize nread, read_length;
+ guint8 *p, *buf, *end;
+ gboolean eof = FALSE;
+ GError *my_error = NULL;
+@@ -251,10 +251,11 @@
+ } else
+ buf = fstream->priv->buf->data;
+
+- /* Scan for the boundary */
+- end = buf + fstream->priv->buf->len;
+- if (!eof)
+- end -= boundary_length;
++ /* Scan for the boundary within the range we can possibly return. */
++ if (include_boundary)
++ end = buf + MIN (fstream->priv->buf->len, length) - boundary_length;
++ else
++ end = buf + MIN (fstream->priv->buf->len - boundary_length, length);
+ for (p = buf; p <= end; p++) {
+ if (*p == *(guint8*)boundary &&
+ !memcmp (p, boundary, boundary_length)) {
+@@ -268,10 +269,9 @@
+ if (!*got_boundary && fstream->priv->buf->len < length && !eof)
+ goto fill_buffer;
+
+- /* Return everything up to 'p' (which is either just after the boundary if
+- * include_boundary is TRUE, just before the boundary if include_boundary is
+- * FALSE, @boundary_len - 1 bytes before the end of the buffer, or end-of-
+- * file).
+- */
+- return read_from_buf (fstream, buffer, p - buf);
++ if (eof && !*got_boundary)
++ read_length = MIN (fstream->priv->buf->len, length);
++ else
++ read_length = p - buf;
++ return read_from_buf (fstream, buffer, read_length);
+ }
diff --git a/patches/source/libsoup/libsoup.SlackBuild b/patches/source/libsoup/libsoup.SlackBuild
new file mode 100755
index 00000000..e4405b03
--- /dev/null
+++ b/patches/source/libsoup/libsoup.SlackBuild
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+# Slackware build script for libsoup
+#
+# Copyright 2009-2010 Erik W. Hanson, Minneapolis, 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.
+
+PKGNAM=libsoup
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-2_slack14.1}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+NUMJOBS=${NUMJOBS:-" -j7 "}
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
+cd $PKGNAM-$VERSION || exit 1
+chown -R root:root .
+chmod -R u+w,go+r-w,a-s .
+
+zcat $CWD/libsoup.CVE-2017-2885.diff.gz | patch -p1 --verbose || exit 1
+
+CFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var/lib \
+ --disable-static \
+ --with-gnome \
+ --build=$ARCH-slackware-linux || exit 1
+
+make $NUMJOBS || make || exit 1
+make install-strip DESTDIR=$PKG || exit 1
+
+## NOTE: These _should_ go eventually, but for now it causes problems.
+## Don't ship .la files:
+#rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la
+
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a COPYING* AUTHORS NEWS README* $PKG/usr/doc/$PKGNAM-$VERSION
+
+# 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/libsoup/slack-desc b/patches/source/libsoup/slack-desc
new file mode 100644
index 00000000..80cd6ef0
--- /dev/null
+++ b/patches/source/libsoup/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------------------------------------------------------|
+libsoup: libsoup (an HTTP client/server library)
+libsoup:
+libsoup: Soup is an HTTP client/server library implementation in C. It uses
+libsoup: GObjects and the glib main loop to integrate well with GTK+
+libsoup: applications, and has a synchronous API suitable for use in threaded
+libsoup: applications.
+libsoup:
+libsoup:
+libsoup:
+libsoup:
+libsoup: