From 810baca7406fa45d1bf9d4fb5d45127c49efdaed Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 2 May 2005 04:32:47 +0000 Subject: Fix segfaults due to lack of error checking #90540 by Tiago Freire. (Portage version: 2.0.51.20-r5) --- app-cdr/bin2iso/ChangeLog | 11 +++++-- app-cdr/bin2iso/bin2iso-19b-r1.ebuild | 27 ----------------- app-cdr/bin2iso/bin2iso-19b-r2.ebuild | 34 ++++++++++++++++++++++ .../bin2iso/files/bin2iso-19b-sanity-checks.patch | 30 +++++++++++++++++++ app-cdr/bin2iso/files/digest-bin2iso-19b-r1 | 1 - app-cdr/bin2iso/files/digest-bin2iso-19b-r2 | 1 + 6 files changed, 74 insertions(+), 30 deletions(-) delete mode 100644 app-cdr/bin2iso/bin2iso-19b-r1.ebuild create mode 100644 app-cdr/bin2iso/bin2iso-19b-r2.ebuild create mode 100644 app-cdr/bin2iso/files/bin2iso-19b-sanity-checks.patch delete mode 100644 app-cdr/bin2iso/files/digest-bin2iso-19b-r1 create mode 100644 app-cdr/bin2iso/files/digest-bin2iso-19b-r2 (limited to 'app-cdr') diff --git a/app-cdr/bin2iso/ChangeLog b/app-cdr/bin2iso/ChangeLog index c52435f86c3a..0b4a3d1c627d 100644 --- a/app-cdr/bin2iso/ChangeLog +++ b/app-cdr/bin2iso/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-cdr/bin2iso -# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-cdr/bin2iso/ChangeLog,v 1.17 2005/01/01 12:08:00 eradicator Exp $ +# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-cdr/bin2iso/ChangeLog,v 1.18 2005/05/02 04:32:47 vapier Exp $ + +*bin2iso-19b-r2 (02 May 2005) + + 02 May 2005; Mike Frysinger + +files/bin2iso-19b-sanity-checks.patch, -bin2iso-19b-r1.ebuild, + +bin2iso-19b-r2.ebuild: + Fix segfaults due to lack of error checking #90540 by Tiago Freire. 03 Apr 2004; Daniel Ahlberg bin2iso-19b-r1.ebuild: Adding amd64 keyword, closing #46530. diff --git a/app-cdr/bin2iso/bin2iso-19b-r1.ebuild b/app-cdr/bin2iso/bin2iso-19b-r1.ebuild deleted file mode 100644 index d5e9ae1c2e91..000000000000 --- a/app-cdr/bin2iso/bin2iso-19b-r1.ebuild +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-cdr/bin2iso/bin2iso-19b-r1.ebuild,v 1.17 2005/01/01 12:08:00 eradicator Exp $ - -inherit gcc - -DESCRIPTION="converts RAW format (.bin/.cue) files to ISO/WAV format" -HOMEPAGE="http://users.andara.com/~doiron/bin2iso/" -SRC_URI="mirror://gentoo/${P}.tar.bz2" - -LICENSE="public-domain" -SLOT="0" -KEYWORDS="x86 ppc sparc alpha amd64" -IUSE="" - -DEPEND="virtual/libc" - -S=${WORKDIR}/${PN} - -src_compile() { - $(gcc-getCC) bin2iso19b_linux.c -o ${PN} ${CFLAGS} || die "compile failed" -} - -src_install() { - dobin ${PN} || die "dobin failed" - dodoc readme.txt -} diff --git a/app-cdr/bin2iso/bin2iso-19b-r2.ebuild b/app-cdr/bin2iso/bin2iso-19b-r2.ebuild new file mode 100644 index 000000000000..f4974d47f838 --- /dev/null +++ b/app-cdr/bin2iso/bin2iso-19b-r2.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-cdr/bin2iso/bin2iso-19b-r2.ebuild,v 1.1 2005/05/02 04:32:47 vapier Exp $ + +inherit eutils toolchain-funcs + +DESCRIPTION="converts RAW format (.bin/.cue) files to ISO/WAV format" +HOMEPAGE="http://users.andara.com/~doiron/bin2iso/" +SRC_URI="mirror://gentoo/${P}.tar.bz2" + +LICENSE="public-domain" +SLOT="0" +KEYWORDS="alpha amd64 ppc sparc x86" +IUSE="" + +DEPEND="" + +S=${WORKDIR}/${PN} + +src_unpack() { + unpack ${A} + cd "${S}" + edos2unix *.c + epatch "${FILESDIR}"/${P}-sanity-checks.patch +} + +src_compile() { + $(tc-getCC) bin2iso19b_linux.c -o ${PN} ${CFLAGS} ${LDFLAGS} || die "compile failed" +} + +src_install() { + dobin ${PN} || die "dobin failed" + dodoc readme.txt +} diff --git a/app-cdr/bin2iso/files/bin2iso-19b-sanity-checks.patch b/app-cdr/bin2iso/files/bin2iso-19b-sanity-checks.patch new file mode 100644 index 000000000000..5803bc103a86 --- /dev/null +++ b/app-cdr/bin2iso/files/bin2iso-19b-sanity-checks.patch @@ -0,0 +1,30 @@ +Add more checks to prevent segfaults in ill-formatted files + +http://bugs.gentoo.org/show_bug.cgi?id=90540 + +--- bin2iso19b_linux.c ++++ bin2iso19b_linux.c +@@ -237,6 +237,10 @@ + // Get the 'mode' + if (strncmp(&Line[2], "TRACK ", 6)==0) + { ++ if (Line[8] < '0' || Line[8] > '9' || Line[9] < '0' || Line[9] > '9') { ++ printf("Error: Track # is not a 2 digit number\n"); ++ exit(1); ++ } + strncpy(track->num, &Line[8], 2); track->num[2] = '\0'; + + track->mode = UNKNOWN; +@@ -246,7 +250,11 @@ + if(strncmp(&Line[11], "MODE2/2352", 10)==0) track->mode = MODE2_2352; + if(strncmp(&Line[11], "MODE2/2336", 10)==0) track->mode = MODE2_2336; + } +- else return(1); ++ else ++ { ++ printf("Error: 2nd line does not begin with ' TRACK '\n"); ++ exit(1); ++ } + + // Set the name + strcpy(track->name, sBinFilename); diff --git a/app-cdr/bin2iso/files/digest-bin2iso-19b-r1 b/app-cdr/bin2iso/files/digest-bin2iso-19b-r1 deleted file mode 100644 index 941c8d1f8e7c..000000000000 --- a/app-cdr/bin2iso/files/digest-bin2iso-19b-r1 +++ /dev/null @@ -1 +0,0 @@ -MD5 45cd3dc6c2efde7eeae9fb25707c8723 bin2iso-19b.tar.bz2 9805 diff --git a/app-cdr/bin2iso/files/digest-bin2iso-19b-r2 b/app-cdr/bin2iso/files/digest-bin2iso-19b-r2 new file mode 100644 index 000000000000..941c8d1f8e7c --- /dev/null +++ b/app-cdr/bin2iso/files/digest-bin2iso-19b-r2 @@ -0,0 +1 @@ +MD5 45cd3dc6c2efde7eeae9fb25707c8723 bin2iso-19b.tar.bz2 9805 -- cgit v1.2.3-65-gdbad