1 |
commit: 4bbc0bd925e32087de9c61bf2bee81d00ec1ad7f |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 28 20:28:00 2017 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 28 20:31:41 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4bbc0bd9 |
7 |
|
8 |
dev-libs/libxls: fix infinite loop on excel files with 65535 rows |
9 |
|
10 |
Reported-by: globus |
11 |
Bug: https://bugs.gentoo.org/607094 |
12 |
|
13 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
14 |
|
15 |
dev-libs/libxls/files/libxls-1.4.0-infinite.patch | 16 ++++++++++++++++ |
16 |
.../{libxls-1.4.0.ebuild => libxls-1.4.0-r1.ebuild} | 1 + |
17 |
2 files changed, 17 insertions(+) |
18 |
|
19 |
diff --git a/dev-libs/libxls/files/libxls-1.4.0-infinite.patch b/dev-libs/libxls/files/libxls-1.4.0-infinite.patch |
20 |
new file mode 100644 |
21 |
index 00000000..6f6e9fc |
22 |
--- /dev/null |
23 |
+++ b/dev-libs/libxls/files/libxls-1.4.0-infinite.patch |
24 |
@@ -0,0 +1,16 @@ |
25 |
+cellRow and cellCol need to be of a type larger than WORD. |
26 |
+Otherwise for for documents with 65535 columns condition |
27 |
+loops forever in the following line: |
28 |
+ for (cellRow = 0; cellRow <= pWS->rows.lastrow; cellRow++) { |
29 |
+In this case <= 65535 is always true. |
30 |
+ |
31 |
+https://bugs.gentoo.org/607094 has an example doc of this kind. |
32 |
+diff --git a/libxls/src/xls2csv.c b/libxls/src/xls2csv.c |
33 |
+index b804267..1f0d4b3 100644 |
34 |
+--- a/src/xls2csv.c |
35 |
++++ b/src/xls2csv.c |
36 |
+@@ -104,3 +104,3 @@ int main(int argc, char *argv[]) { |
37 |
+ struct st_row_data* row; |
38 |
+- WORD cellRow, cellCol; |
39 |
++ DWORD cellRow, cellCol; |
40 |
+ |
41 |
|
42 |
diff --git a/dev-libs/libxls/libxls-1.4.0.ebuild b/dev-libs/libxls/libxls-1.4.0-r1.ebuild |
43 |
similarity index 94% |
44 |
rename from dev-libs/libxls/libxls-1.4.0.ebuild |
45 |
rename to dev-libs/libxls/libxls-1.4.0-r1.ebuild |
46 |
index 431c400..bb23a6c 100644 |
47 |
--- a/dev-libs/libxls/libxls-1.4.0.ebuild |
48 |
+++ b/dev-libs/libxls/libxls-1.4.0-r1.ebuild |
49 |
@@ -25,6 +25,7 @@ S="${WORKDIR}/${PN}" |
50 |
|
51 |
PATCHES=( |
52 |
"${FILESDIR}"/${P}-asprintf.patch |
53 |
+ "${FILESDIR}"/${P}-infinite.patch |
54 |
) |
55 |
|
56 |
src_configure() { |