diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2017-01-28 20:28:00 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2017-01-28 20:31:41 +0000 |
commit | 4bbc0bd925e32087de9c61bf2bee81d00ec1ad7f (patch) | |
tree | 72d7009d23e1e8b2562290fd0fec913837e60043 | |
parent | sys-kernel/hardened-sources: remove older versions (diff) | |
download | gentoo-4bbc0bd925e32087de9c61bf2bee81d00ec1ad7f.tar.gz gentoo-4bbc0bd925e32087de9c61bf2bee81d00ec1ad7f.tar.bz2 gentoo-4bbc0bd925e32087de9c61bf2bee81d00ec1ad7f.zip |
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
-rw-r--r-- | dev-libs/libxls/files/libxls-1.4.0-infinite.patch | 16 | ||||
-rw-r--r-- | dev-libs/libxls/libxls-1.4.0-r1.ebuild (renamed from dev-libs/libxls/libxls-1.4.0.ebuild) | 1 |
2 files changed, 17 insertions, 0 deletions
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 000000000000..6f6e9fc1e1ec --- /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.ebuild b/dev-libs/libxls/libxls-1.4.0-r1.ebuild index 431c4003b7f0..bb23a6c7517e 100644 --- a/dev-libs/libxls/libxls-1.4.0.ebuild +++ b/dev-libs/libxls/libxls-1.4.0-r1.ebuild @@ -25,6 +25,7 @@ S="${WORKDIR}/${PN}" PATCHES=( "${FILESDIR}"/${P}-asprintf.patch + "${FILESDIR}"/${P}-infinite.patch ) src_configure() { |