summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2009-08-06 11:58:13 +0000
committerAlexis Ballier <aballier@gentoo.org>2009-08-06 11:58:13 +0000
commit74adc7da99ccac3adf8dad80fa95db0ac77bbe0d (patch)
tree6ee9f5f6bbd72aaecb5d38401294db9afaf03d86 /app-text/lyx2html
parentFix building with GLIBC 2.10+ wrt #273987. (diff)
downloadhistorical-74adc7da99ccac3adf8dad80fa95db0ac77bbe0d.tar.gz
historical-74adc7da99ccac3adf8dad80fa95db0ac77bbe0d.tar.bz2
historical-74adc7da99ccac3adf8dad80fa95db0ac77bbe0d.zip
Fix buffer overflows causing segfaults due to badly allocated pointers... spotted by Diego E. 'Flameeyes' Pettenò <flameeyes@gentoo.org>, bug #278136. Also honour LDFLAGS
Package-Manager: portage-2.2_rc36/cvs/Linux x86_64
Diffstat (limited to 'app-text/lyx2html')
-rw-r--r--app-text/lyx2html/ChangeLog13
-rw-r--r--app-text/lyx2html/Manifest16
-rw-r--r--app-text/lyx2html/files/lyx2html-0.2-alloc.patch80
-rw-r--r--app-text/lyx2html/files/lyx2html-0.2-ldflags.patch13
-rw-r--r--app-text/lyx2html/lyx2html-0.2-r1.ebuild (renamed from app-text/lyx2html/lyx2html-0.2.ebuild)16
5 files changed, 130 insertions, 8 deletions
diff --git a/app-text/lyx2html/ChangeLog b/app-text/lyx2html/ChangeLog
index 0aacfa697886..8c122bd055bc 100644
--- a/app-text/lyx2html/ChangeLog
+++ b/app-text/lyx2html/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for app-text/lyx2html
-# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/lyx2html/ChangeLog,v 1.5 2007/03/12 23:53:59 nattfodd Exp $
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/lyx2html/ChangeLog,v 1.6 2009/08/06 11:58:13 aballier Exp $
+
+*lyx2html-0.2-r1 (06 Aug 2009)
+
+ 06 Aug 2009; Alexis Ballier <aballier@gentoo.org> -lyx2html-0.2.ebuild,
+ +lyx2html-0.2-r1.ebuild, +files/lyx2html-0.2-alloc.patch,
+ +files/lyx2html-0.2-ldflags.patch:
+ Fix buffer overflows causing segfaults due to badly allocated pointers...
+ spotted by Diego E. 'Flameeyes' Pettenò <flameeyes@gentoo.org>, bug
+ #278136. Also honour LDFLAGS
12 Mar 2007; Alexandre Buisse <nattfodd@gentoo.org> metadata.xml:
Replaced text-markup by tex as maintaining herd (text-markup split).
diff --git a/app-text/lyx2html/Manifest b/app-text/lyx2html/Manifest
index 31efc72b3fb4..2b216fda8781 100644
--- a/app-text/lyx2html/Manifest
+++ b/app-text/lyx2html/Manifest
@@ -1,4 +1,16 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+AUX lyx2html-0.2-alloc.patch 2341 RMD160 b4319388ed01527f5596bed5ef9a131820e0b38e SHA1 7d8249909631cb4eca2e9ea533f68f2973738c68 SHA256 6ea1b43c83a22ea97025e2de5ef2f4fd958e53f5854f7da4405e0fc2ca90d3e2
+AUX lyx2html-0.2-ldflags.patch 373 RMD160 8dae7bb4dfb3a274084ff72d713e47f0cdb0c393 SHA1 e0cfe62652f8357a90a6a41fac85e7fa1dae4cd3 SHA256 960a52194c7dea6db28787f0225d286c89fb0883f42ec6d89a722ee44d40f771
DIST lyx2html-0.2.tar.gz 19083 RMD160 994a023de5f954553136a2a4372845e76398866f SHA1 f5cad3fbe7c841baffea9c8e7a8070984105af24 SHA256 5cd61b856c4aa0dc6b386d2e2dccaecf2bea5fa2708d8d86ccb05534b771b3fd
-EBUILD lyx2html-0.2.ebuild 707 RMD160 9a5754186e7fde09aa7d8a630e060f200b7e5a82 SHA1 865f07ec0521ab635c51ec91be852ac966bb37ee SHA256 d980763e20d01259e0f582be9be0c2266c2945ad705325eb1d3b40d97e16593e
-MISC ChangeLog 848 RMD160 5e9dbcf8fdb1345fdbd60873331a8c68823731c1 SHA1 bf3d86396fbb674b57a8d31625db1a3118237236 SHA256 ca5ade5aefe11edd1547bb0e40b9261444401caca0634b3744465a6e88630f29
+EBUILD lyx2html-0.2-r1.ebuild 854 RMD160 e7f56eeeafbf459df1c9b188cdc10d88c77cdb3a SHA1 22c79bf4b3d8d1ce6729426285ecd3fcabfb0e87 SHA256 bafd4dae18ab4388ec133504fa64628b7c24723869d19e15b2ac219d9488f4af
+MISC ChangeLog 1230 RMD160 28e34faa60ebc8e9cdb688edbd0e2c7d26c75439 SHA1 4aad92b1047ef84bed79a031c92c3a8e13d6cfb0 SHA256 f1b6133d9a093c089ff22831faa2ba8ba01ccaf2b72e4779eb4286f994937ab0
MISC metadata.xml 156 RMD160 2bf6b2ed9ff0fcef1e902cf093ccf4ae2dcc70a0 SHA1 e9260cd53905d8569cf3327ded4c6d01653fc389 SHA256 b4971b8472ab3fe4fbfe41b331a79193ca19e86c08d055ad1c20eaf9e04b79b6
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.11 (GNU/Linux)
+
+iEYEARECAAYFAkp6xWAACgkQvFcC4BYPU0qe1ACeL0a+uzlxwNhiyWgysx5YuzaH
+Nh8AoJcablqURYrDWqWe+U6ZHyTE4UpG
+=Ac12
+-----END PGP SIGNATURE-----
diff --git a/app-text/lyx2html/files/lyx2html-0.2-alloc.patch b/app-text/lyx2html/files/lyx2html-0.2-alloc.patch
new file mode 100644
index 000000000000..0145d2af1925
--- /dev/null
+++ b/app-text/lyx2html/files/lyx2html-0.2-alloc.patch
@@ -0,0 +1,80 @@
+Index: lyx2html-0.2/document.c
+===================================================================
+--- lyx2html-0.2.orig/document.c
++++ lyx2html-0.2/document.c
+@@ -70,7 +70,7 @@ void documentParseSubSubSection(LYXDOCUM
+
+ if (start)
+ {
+- if(!fgets(theline, filesize, read))
++ if(!fgets(theline, sizeof(theline), read))
+ {
+ break;
+ }
+@@ -114,7 +114,7 @@ void documentParseSubSubSection(LYXDOCUM
+ documentParseSection(doc, read, filename);
+ return;
+ }
+- } while (fgets(theline,filesize,read));
++ } while (fgets(theline,sizeof(theline),read));
+ }
+
+ void documentParseSubSection(LYXDOCUMENT *doc, FILE *read, char * filename)
+@@ -131,7 +131,7 @@ void documentParseSubSection(LYXDOCUMENT
+
+ if (start)
+ {
+- if(!fgets(theline, filesize, read))
++ if(!fgets(theline, sizeof(theline), read))
+ {
+ break;
+ }
+@@ -173,7 +173,7 @@ void documentParseSubSection(LYXDOCUMENT
+ subsubsec++;
+ documentParseSubSubSection(doc, read, filename);
+ }
+- } while (fgets(theline,filesize,read));
++ } while (fgets(theline,sizeof(theline),read));
+ }
+
+ int documentSubSection(LYXDOCUMENT *doc, char * line)
+@@ -212,7 +212,7 @@ void documentParseSection (LYXDOCUMENT *
+
+ if (start)
+ {
+- if(!fgets(theline, filesize, read))
++ if(!fgets(theline, sizeof(theline), read))
+ {
+ break;
+ }
+@@ -242,7 +242,7 @@ void documentParseSection (LYXDOCUMENT *
+ subsubsec = 0;
+ documentParseSubSection(doc, read, filename);
+ }
+- } while (fgets(theline,filesize,read));
++ } while (fgets(theline,sizeof(theline),read));
+ }
+
+ struct LYXDOCUMENT * initNewDoc()
+@@ -288,7 +288,7 @@ struct LYXDOCUMENT * newDoc(char *create
+ int abstract = 0;
+ int start = 0;
+
+- while (fgets(theline,filesize,read))
++ while (fgets(theline,sizeof(theline),read))
+ {
+ linenum++;
+
+Index: lyx2html-0.2/section.c
+===================================================================
+--- lyx2html-0.2.orig/section.c
++++ lyx2html-0.2/section.c
+@@ -34,7 +34,7 @@ struct SECTION * newSection(SECTYPE type
+ {
+ struct SECTION *init;
+
+- init = malloc(filesize);
++ init = malloc(sizeof(struct SECTION));
+
+ /* limit for the name of section is hardcoded */
+ init->name = malloc(240);
diff --git a/app-text/lyx2html/files/lyx2html-0.2-ldflags.patch b/app-text/lyx2html/files/lyx2html-0.2-ldflags.patch
new file mode 100644
index 000000000000..a23897af40c8
--- /dev/null
+++ b/app-text/lyx2html/files/lyx2html-0.2-ldflags.patch
@@ -0,0 +1,13 @@
+Index: lyx2html-0.2/Makefile
+===================================================================
+--- lyx2html-0.2.orig/Makefile
++++ lyx2html-0.2/Makefile
+@@ -10,7 +10,7 @@ COPTS = -O3 -Wall
+ ############################################
+
+ all: $(OFILES)
+- $(CC) $(OFILES) -o lyx2html
++ $(CC) $(LDFLAGS) $(OFILES) -o lyx2html
+
+ document.o: document.h
+ main.o: main.h
diff --git a/app-text/lyx2html/lyx2html-0.2.ebuild b/app-text/lyx2html/lyx2html-0.2-r1.ebuild
index 3c5164dcdcb0..8543faa5e34a 100644
--- a/app-text/lyx2html/lyx2html-0.2.ebuild
+++ b/app-text/lyx2html/lyx2html-0.2-r1.ebuild
@@ -1,8 +1,8 @@
-# Copyright 1999-2005 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/lyx2html/lyx2html-0.2.ebuild,v 1.3 2005/10/15 20:31:08 blubb Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-text/lyx2html/lyx2html-0.2-r1.ebuild,v 1.1 2009/08/06 11:58:13 aballier Exp $
-inherit toolchain-funcs
+inherit toolchain-funcs eutils
DESCRIPTION="A very simple Lyx to HTML command line converter"
SRC_URI="http://www.netmeister.org/apps/${P}.tar.gz"
@@ -12,9 +12,17 @@ SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE=""
DEPEND=""
+RDEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}/${P}-alloc.patch"
+ epatch "${FILESDIR}/${P}-ldflags.patch"
+}
src_compile() {
- make CC=$(tc-getCC) COPTS="${CFLAGS}" || die
+ emake CC=$(tc-getCC) COPTS="${CFLAGS}" || die
}
src_test() {