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
commit8c8b7956d4a4eca8b9b75a15c05562084233220e (patch)
tree7849460d78f8b2b28e18b199774a7745e3e5275a /app-text/lyx2html
parentFix building with GLIBC 2.10+ wrt #273987. (diff)
downloadgentoo-2-8c8b7956d4a4eca8b9b75a15c05562084233220e.tar.gz
gentoo-2-8c8b7956d4a4eca8b9b75a15c05562084233220e.tar.bz2
gentoo-2-8c8b7956d4a4eca8b9b75a15c05562084233220e.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
(Portage version: 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/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
4 files changed, 116 insertions, 6 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/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() {