summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user/plib/APKBUILD50
-rw-r--r--user/plib/fix-openflight.patch25
-rw-r--r--user/plib/plib-1.8.5-CVE-2011-4620.patch11
-rw-r--r--user/plib/plib-1.8.5-CVE-2012-4552.patch54
4 files changed, 140 insertions, 0 deletions
diff --git a/user/plib/APKBUILD b/user/plib/APKBUILD
new file mode 100644
index 000000000..7f8f95cee
--- /dev/null
+++ b/user/plib/APKBUILD
@@ -0,0 +1,50 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=plib
+pkgver=1.8.5
+pkgrel=0
+pkgdesc="Portable game libraries"
+url="http://plib.sourceforge.net/"
+arch="all"
+options="!dbg" # No shared libraries
+license="LGPL-2.0+"
+depends=""
+makedepends="libxi-dev libxmu-dev libxt-dev mesa-dev"
+subpackages="$pkgname-dev"
+source="http://plib.sourceforge.net/dist/plib-$pkgver.tar.gz
+ fix-openflight.patch
+ plib-1.8.5-CVE-2011-4620.patch
+ plib-1.8.5-CVE-2012-4552.patch
+ "
+
+prepare() {
+ default_prepare
+ update_config_sub
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="17154cc77243fe576c2bcbcb0285b98aef1a0634658f5473e95fe0ac8fa3ed477dbe5620e44ccf0b7cc616f812af0cd44d6fcbba0c563180d3b61c9d6f158e1d plib-1.8.5.tar.gz
+fac9c78a57a0c564c46d586ebf541b45cf7dc838387498f3263bac78f0f78c53c85000667d6dfd349e328b1cd4254ac0d786dd825aefbe957f94e6d3b91ec41b fix-openflight.patch
+c046cf65e80629f238aaba724f522c31b434f5c9687ea02b019846ce3469c6b074bd014f81a7a4e6b43db7b084f4dcd9d4c04b557dbc1b8b8ca00f2d782fdf1c plib-1.8.5-CVE-2011-4620.patch
+a09462ecb085703aae7cd3b77954cc800410aa37a9616255cca2f21456e6d5dcf8ead3f684c98236deb1455c6a034dc8ec874bafdbab003f7a63517ea1f8350d plib-1.8.5-CVE-2012-4552.patch"
diff --git a/user/plib/fix-openflight.patch b/user/plib/fix-openflight.patch
new file mode 100644
index 000000000..7c69c1cd1
--- /dev/null
+++ b/user/plib/fix-openflight.patch
@@ -0,0 +1,25 @@
+--- plib-1.8.5/src/ssg/ssgLoadFLT.cxx.old 2008-03-11 02:06:23.000000000 +0000
++++ plib-1.8.5/src/ssg/ssgLoadFLT.cxx 2018-10-23 22:02:06.650000000 +0000
+@@ -103,9 +103,7 @@
+ #include <string.h>
+ #include <fcntl.h>
+ #include <stdio.h>
+-#ifdef UL_IRIX
+-# include <sys/endian.h>
+-#endif
++#include <endian.h>
+ #ifdef USE_POSIX_MMAP
+ # include <time.h>
+ # include <sys/time.h> /* Need both for Mandrake 8.0 !! */
+@@ -141,11 +139,8 @@
+ #define template _template /* trams */
+
+ typedef unsigned char ubyte;
+-
+-#ifdef UL_WIN32
+ typedef unsigned short ushort;
+ typedef unsigned int uint;
+-#endif
+
+ // 525 = negative identation, 539= did not expect positive identation
+ //lint -save -e525 -e539
diff --git a/user/plib/plib-1.8.5-CVE-2011-4620.patch b/user/plib/plib-1.8.5-CVE-2011-4620.patch
new file mode 100644
index 000000000..41fac5fe4
--- /dev/null
+++ b/user/plib/plib-1.8.5-CVE-2011-4620.patch
@@ -0,0 +1,11 @@
+--- plib-1.8.5/src/util/ulError.cxx~ 2008-03-11 03:06:23.000000000 +0100
++++ plib-1.8.5/src/util/ulError.cxx 2011-12-27 15:38:25.305676650 +0100
+@@ -39,7 +39,7 @@ void ulSetError ( enum ulSeverity severi
+ {
+ va_list argp;
+ va_start ( argp, fmt ) ;
+- vsprintf ( _ulErrorBuffer, fmt, argp ) ;
++ vsnprintf ( _ulErrorBuffer, sizeof(_ulErrorBuffer), fmt, argp ) ;
+ va_end ( argp ) ;
+
+ if ( _ulErrorCB )
diff --git a/user/plib/plib-1.8.5-CVE-2012-4552.patch b/user/plib/plib-1.8.5-CVE-2012-4552.patch
new file mode 100644
index 000000000..78f1b22ae
--- /dev/null
+++ b/user/plib/plib-1.8.5-CVE-2012-4552.patch
@@ -0,0 +1,54 @@
+--- plib-1.8.5/src/ssg/ssgParser.cxx~
++++ plib-1.8.5/src/ssg/ssgParser.cxx
+@@ -57,18 +57,16 @@ void _ssgParser::error( const char *form
+ char msgbuff[ 255 ];
+ va_list argp;
+
+- char* msgptr = msgbuff;
+- if (linenum)
+- {
+- msgptr += sprintf ( msgptr,"%s, line %d: ",
+- path, linenum );
+- }
+-
+ va_start( argp, format );
+- vsprintf( msgptr, format, argp );
++ vsnprintf( msgbuff, sizeof(msgbuff), format, argp );
+ va_end( argp );
+
+- ulSetError ( UL_WARNING, "%s", msgbuff ) ;
++ if (linenum)
++ {
++ ulSetError ( UL_WARNING, "%s, line %d: %s", path, linenum, msgbuff ) ;
++ } else {
++ ulSetError ( UL_WARNING, "%s", msgbuff ) ;
++ }
+ }
+
+
+@@ -78,18 +76,16 @@ void _ssgParser::message( const char *fo
+ char msgbuff[ 255 ];
+ va_list argp;
+
+- char* msgptr = msgbuff;
+- if (linenum)
+- {
+- msgptr += sprintf ( msgptr,"%s, line %d: ",
+- path, linenum );
+- }
+-
+ va_start( argp, format );
+- vsprintf( msgptr, format, argp );
++ vsnprintf( msgbuff, sizeof(msgbuff), format, argp );
+ va_end( argp );
+
+- ulSetError ( UL_DEBUG, "%s", msgbuff ) ;
++ if (linenum)
++ {
++ ulSetError ( UL_DEBUG, "%s, line %d: %s", path, linenum, msgbuff ) ;
++ } else {
++ ulSetError ( UL_DEBUG, "%s", msgbuff ) ;
++ }
+ }
+
+ // Opens the file and does a few internal calculations based on the spec.