From 4bbc0bd925e32087de9c61bf2bee81d00ec1ad7f Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 28 Jan 2017 20:28:00 +0000 Subject: dev-libs/libxls: fix infinite loop on excel files with 65535 rows Reported-by: globus Bug: https://bugs.gentoo.org/607094 Package-Manager: Portage-2.3.3, Repoman-2.3.1 --- dev-libs/libxls/files/libxls-1.4.0-infinite.patch | 16 +++++++++ dev-libs/libxls/libxls-1.4.0-r1.ebuild | 40 +++++++++++++++++++++++ dev-libs/libxls/libxls-1.4.0.ebuild | 39 ---------------------- 3 files changed, 56 insertions(+), 39 deletions(-) create mode 100644 dev-libs/libxls/files/libxls-1.4.0-infinite.patch create mode 100644 dev-libs/libxls/libxls-1.4.0-r1.ebuild delete mode 100644 dev-libs/libxls/libxls-1.4.0.ebuild (limited to 'dev-libs/libxls') diff --git a/dev-libs/libxls/files/libxls-1.4.0-infinite.patch b/dev-libs/libxls/files/libxls-1.4.0-infinite.patch new file mode 100644 index 00000000000..6f6e9fc1e1e --- /dev/null +++ b/dev-libs/libxls/files/libxls-1.4.0-infinite.patch @@ -0,0 +1,16 @@ +cellRow and cellCol need to be of a type larger than WORD. +Otherwise for for documents with 65535 columns condition +loops forever in the following line: + for (cellRow = 0; cellRow <= pWS->rows.lastrow; cellRow++) { +In this case <= 65535 is always true. + +https://bugs.gentoo.org/607094 has an example doc of this kind. +diff --git a/libxls/src/xls2csv.c b/libxls/src/xls2csv.c +index b804267..1f0d4b3 100644 +--- a/src/xls2csv.c ++++ b/src/xls2csv.c +@@ -104,3 +104,3 @@ int main(int argc, char *argv[]) { + struct st_row_data* row; +- WORD cellRow, cellCol; ++ DWORD cellRow, cellCol; + diff --git a/dev-libs/libxls/libxls-1.4.0-r1.ebuild b/dev-libs/libxls/libxls-1.4.0-r1.ebuild new file mode 100644 index 00000000000..bb23a6c7517 --- /dev/null +++ b/dev-libs/libxls/libxls-1.4.0-r1.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit eutils + +DESCRIPTION="A library which can read Excel (xls) files" +HOMEPAGE="http://libxls.sourceforge.net/" +SRC_URI="mirror://sourceforge/project/libxls/${P}.zip" + +LICENSE="GPL-2 LGPL-3" +SLOT="0/1" # libxlsreader.so.1 +KEYWORDS="~amd64 ~x86" +IUSE="" + +RDEPEND="" +DEPEND="${RDEPEND} + virtual/pkgconfig" + +RESTRICT=test # test driver is missing + +S="${WORKDIR}/${PN}" + +PATCHES=( + "${FILESDIR}"/${P}-asprintf.patch + "${FILESDIR}"/${P}-infinite.patch +) + +src_configure() { + econf \ + --disable-static +} + +src_install() { + default + + prune_libtool_files +} diff --git a/dev-libs/libxls/libxls-1.4.0.ebuild b/dev-libs/libxls/libxls-1.4.0.ebuild deleted file mode 100644 index 431c4003b7f..00000000000 --- a/dev-libs/libxls/libxls-1.4.0.ebuild +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI=6 - -inherit eutils - -DESCRIPTION="A library which can read Excel (xls) files" -HOMEPAGE="http://libxls.sourceforge.net/" -SRC_URI="mirror://sourceforge/project/libxls/${P}.zip" - -LICENSE="GPL-2 LGPL-3" -SLOT="0/1" # libxlsreader.so.1 -KEYWORDS="~amd64 ~x86" -IUSE="" - -RDEPEND="" -DEPEND="${RDEPEND} - virtual/pkgconfig" - -RESTRICT=test # test driver is missing - -S="${WORKDIR}/${PN}" - -PATCHES=( - "${FILESDIR}"/${P}-asprintf.patch -) - -src_configure() { - econf \ - --disable-static -} - -src_install() { - default - - prune_libtool_files -} -- cgit v1.2.1