summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald van Dijk <truedfx@gentoo.org>2009-02-02 19:02:27 +0000
committerHarald van Dijk <truedfx@gentoo.org>2009-02-02 19:02:27 +0000
commit475bbd86182174e99fdf1474d65381a7b92d5063 (patch)
tree8d37bb47eb779f72d3bc7ff9b466686e282f27db /sys-devel/dev86
parentAdd patch from upstream to fix testsuite failures. (bug #253122) (diff)
downloadgentoo-2-475bbd86182174e99fdf1474d65381a7b92d5063.tar.gz
gentoo-2-475bbd86182174e99fdf1474d65381a7b92d5063.tar.bz2
gentoo-2-475bbd86182174e99fdf1474d65381a7b92d5063.zip
Fix possible buffer overflow (#256782)
(Portage version: 2.2_rc23/cvs/Linux x86_64)
Diffstat (limited to 'sys-devel/dev86')
-rw-r--r--sys-devel/dev86/ChangeLog10
-rw-r--r--sys-devel/dev86/dev86-0.16.17-r6.ebuild60
-rw-r--r--sys-devel/dev86/files/dev86-0.16.17-fortify.patch43
3 files changed, 111 insertions, 2 deletions
diff --git a/sys-devel/dev86/ChangeLog b/sys-devel/dev86/ChangeLog
index ef9964250fbc..28c0e5e03c94 100644
--- a/sys-devel/dev86/ChangeLog
+++ b/sys-devel/dev86/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-devel/dev86
-# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/dev86/ChangeLog,v 1.12 2008/03/06 16:20:46 angelos Exp $
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/dev86/ChangeLog,v 1.13 2009/02/02 19:02:27 truedfx Exp $
+
+*dev86-0.16.17-r6 (02 Feb 2009)
+
+ 02 Feb 2009; Harald van Dijk <truedfx@gentoo.org>
+ +files/dev86-0.16.17-fortify.patch, +dev86-0.16.17-r6.ebuild:
+ Fix possible buffer overflow (#256782)
06 Mar 2008; Christoph Mende <angelos@gentoo.org> dev86-0.16.17-r5.ebuild:
Stable on amd64, bug #208905
diff --git a/sys-devel/dev86/dev86-0.16.17-r6.ebuild b/sys-devel/dev86/dev86-0.16.17-r6.ebuild
new file mode 100644
index 000000000000..19a1d6edf0ca
--- /dev/null
+++ b/sys-devel/dev86/dev86-0.16.17-r6.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/dev86/dev86-0.16.17-r6.ebuild,v 1.1 2009/02/02 19:02:27 truedfx Exp $
+
+inherit eutils
+
+DESCRIPTION="Bruce's C compiler - Simple C compiler to generate 8086 code"
+HOMEPAGE="http://www.cix.co.uk/~mayday"
+SRC_URI="http://www.cix.co.uk/~mayday/dev86/Dev86src-${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="sys-devel/bin86"
+DEPEND="${RDEPEND}
+ dev-util/gperf"
+
+src_unpack() {
+ unpack ${A}
+ # elksemu doesn't compile under amd64
+ if use amd64; then
+ einfo "Not compiling elksemu on amd64"
+ sed -i.orig \
+ -e 's,alt-libs elksemu,alt-libs,' \
+ -e 's,install-lib install-emu,install-lib,' \
+ "${S}"/makefile.in
+ fi
+ cd "${S}"
+ epatch "${FILESDIR}/dev86-pic.patch"
+ epatch "${FILESDIR}"/${P}-fortify.patch
+ sed -i -e "s/-O2 -g/${CFLAGS}/" \
+ -e "s/INEXE=-m 755 -s/INEXE=-m 755/g" makefile.in
+ sed -i -e "s/INSTALL_OPTS=-m 755 -s/INSTALL_OPTS=-m 755/g" bin86/Makefile
+ sed -i -e "s/install -m 755 -s/install -m 755/g" dis88/Makefile
+}
+
+src_compile() {
+ emake -j1 DIST="${D}" || die
+
+ export PATH=${S}/bin:${PATH}
+ cd bin
+ ln -s ncc bcc
+ cd ..
+ cd bootblocks
+ ln -s ../bcc/version.h .
+ emake DIST="${D}" || die
+}
+
+src_install() {
+ make install-all DIST="${D}" || die
+ dobin bootblocks/makeboot
+ # remove all the stuff supplied by bin86
+ cd "${D}"
+ rm usr/bin/{as,ld,nm,objdump,size}86
+ rm usr/man/man1/{as,ld}86.1
+ mkdir -p usr/share/man
+ mv usr/man usr/share/
+}
diff --git a/sys-devel/dev86/files/dev86-0.16.17-fortify.patch b/sys-devel/dev86/files/dev86-0.16.17-fortify.patch
new file mode 100644
index 000000000000..715d0c4ca687
--- /dev/null
+++ b/sys-devel/dev86/files/dev86-0.16.17-fortify.patch
@@ -0,0 +1,43 @@
+--- dev86-0.16.17/bcc/bcc.c
++++ dev86-0.16.17/bcc/bcc.c
+@@ -19,6 +19,7 @@
+ #ifdef __STDC__
+ #include <stdlib.h>
+ #ifndef MSDOS
++#include <limits.h>
+ #include <unistd.h>
+ #endif
+ #else
+@@ -596,12 +597,17 @@
+ }
+ }
+
+-void
+-command_reset()
+-{
+ #ifndef MAXPATHLEN
++#ifdef PATH_MAX
++#define MAXPATHLEN PATH_MAX
++#else
+ #define MAXPATHLEN 1024
+ #endif
++#endif
++
++void
++command_reset()
++{
+ char buf[MAXPATHLEN];
+ char ** prefix;
+ char * saved_cmd;
+@@ -1308,11 +1314,7 @@
+
+ for(d=s=ptr; d && *s; s=d)
+ {
+-#ifdef MAXPATHLEN
+ char buf[MAXPATHLEN];
+-#else
+- char buf[1024];
+-#endif
+
+ free(temp);
+ d=strchr(s, ':');