summaryrefslogtreecommitdiffstats
path: root/source/l/glib2
diff options
context:
space:
mode:
Diffstat (limited to 'source/l/glib2')
-rw-r--r--source/l/glib2/glib-CVE-2008-4316.diff62
-rwxr-xr-xsource/l/glib2/glib2.SlackBuild34
2 files changed, 26 insertions, 70 deletions
diff --git a/source/l/glib2/glib-CVE-2008-4316.diff b/source/l/glib2/glib-CVE-2008-4316.diff
deleted file mode 100644
index 5d9bddee1..000000000
--- a/source/l/glib2/glib-CVE-2008-4316.diff
+++ /dev/null
@@ -1,62 +0,0 @@
---- trunk/glib/gbase64.c 2009/02/23 04:30:06 7897
-+++ trunk/glib/gbase64.c 2009/03/12 13:30:55 7973
-@@ -54,8 +54,9 @@
- *
- * The output buffer must be large enough to fit all the data that will
- * be written to it. Due to the way base64 encodes you will need
-- * at least: @len * 4 / 3 + 6 bytes. If you enable line-breaking you will
-- * need at least: @len * 4 / 3 + @len * 4 / (3 * 72) + 7 bytes.
-+ * at least: (@len / 3 + 1) * 4 + 4 bytes (+ 4 may be needed in case of
-+ * non-zero state). If you enable line-breaking you will need at least:
-+ * ((@len / 3 + 1) * 4 + 4) / 72 + 1 bytes of extra space.
- *
- * @break_lines is typically used when putting base64-encoded data in emails.
- * It breaks the lines at 72 columns instead of putting all of the text on
-@@ -233,8 +234,14 @@
- g_return_val_if_fail (data != NULL, NULL);
- g_return_val_if_fail (len > 0, NULL);
-
-- /* We can use a smaller limit here, since we know the saved state is 0 */
-- out = g_malloc (len * 4 / 3 + 4);
-+ /* We can use a smaller limit here, since we know the saved state is 0,
-+ +1 is needed for trailing \0, also check for unlikely integer overflow */
-+ if (len >= ((G_MAXSIZE - 1) / 4 - 1) * 3)
-+ g_error("%s: input too large for Base64 encoding (%"G_GSIZE_FORMAT" chars)",
-+ G_STRLOC, len);
-+
-+ out = g_malloc ((len / 3 + 1) * 4 + 1);
-+
- outlen = g_base64_encode_step (data, len, FALSE, out, &state, &save);
- outlen += g_base64_encode_close (FALSE, out + outlen, &state, &save);
- out[outlen] = '\0';
-@@ -275,7 +282,8 @@
- *
- * The output buffer must be large enough to fit all the data that will
- * be written to it. Since base64 encodes 3 bytes in 4 chars you need
-- * at least: @len * 3 / 4 bytes.
-+ * at least: (@len / 4) * 3 + 3 bytes (+ 3 may be needed in case of non-zero
-+ * state).
- *
- * Return value: The number of bytes of output that was written
- *
-@@ -358,7 +366,8 @@
- gsize *out_len)
- {
- guchar *ret;
-- gint input_length, state = 0;
-+ gsize input_length;
-+ gint state = 0;
- guint save = 0;
-
- g_return_val_if_fail (text != NULL, NULL);
-@@ -368,7 +377,9 @@
-
- g_return_val_if_fail (input_length > 1, NULL);
-
-- ret = g_malloc0 (input_length * 3 / 4);
-+ /* We can use a smaller limit here, since we know the saved state is 0,
-+ +1 used to avoid calling g_malloc0(0), and hence retruning NULL */
-+ ret = g_malloc0 ((input_length / 4) * 3 + 1);
-
- *out_len = g_base64_decode_step (text, input_length, ret, &state, &save);
-
diff --git a/source/l/glib2/glib2.SlackBuild b/source/l/glib2/glib2.SlackBuild
index 23211af80..b662e37f3 100755
--- a/source/l/glib2/glib2.SlackBuild
+++ b/source/l/glib2/glib2.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,17 +21,24 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=${VERSION:-2.18.4}
-ARCH=${ARCH:-x86_64}
+VERSION=${VERSION:-$(echo glib-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}
NUMJOBS=${NUMJOBS:-" -j7 "}
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-glib2
-rm -rf $PKG
-mkdir -p $TMP $PKG/usr
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
@@ -42,15 +49,18 @@ elif [ "$ARCH" = "s390" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
+rm -rf $PKG
+mkdir -p $TMP $PKG/usr
cd $TMP
rm -rf glib-$VERSION
-tar xvf $CWD/glib-$VERSION.tar.bz2 || exit 1
+tar xvf $CWD/glib-$VERSION.tar.?z* || exit 1
cd glib-$VERSION
-zcat $CWD/glib-CVE-2008-4316.diff.gz | patch -p1 --verbose || exit 1
-
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -91,6 +101,14 @@ cp -a \
$PKG/usr/doc/glib-$VERSION
( cd $PKG/usr/doc/glib-$VERSION ; ln -s /usr/share/gtk-doc/html/gobject 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/*-$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
zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh