[gnumeric] xls: improve handling of broken files.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] xls: improve handling of broken files.
- Date: Sun, 21 Apr 2013 01:14:40 +0000 (UTC)
commit 754816d0dd3b4fc93c4590ceb4ecc6a20162c5d8
Author: Morten Welinder <terra gnome org>
Date: Sat Apr 20 12:02:11 2013 -0400
xls: improve handling of broken files.
NEWS | 1 +
plugins/excel/ChangeLog | 6 ++++++
plugins/excel/ms-excel-read.c | 3 ++-
3 files changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/NEWS b/NEWS
index 581169c..78e1b99 100644
--- a/NEWS
+++ b/NEWS
@@ -57,6 +57,7 @@ Morten:
* Improve vertical toolbars. [#590889]
* Merge long format toolbar into regular one.
* Work around gtk+ behaviour change. [#689283]
+ * Improve handling of broken xls. [#698424]
--------------------------------------------------------------------------
Gnumeric 1.12.1
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 192f4eb..22c2502 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-20 Morten Welinder <terra gnome org>
+
+ * ms-excel-read.c (excel_read_name_str): Make sure we don't end up
+ requesting (size_t)-1 characters worth of data. Fixes #698424,
+ initial item.
+
2013-04-15 Morten Welinder <terra gnome org>
* ms-formula-write.c (write_arrays): Handle empty values properly.
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index afa8ceb..a01997c 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -3748,7 +3748,7 @@ excel_read_name_str (GnmXLImporter *importer,
* and stored the id as a character (possibly two byte).
* NOTE : len is in _characters_ (not bytes) does not include
* the header */
- if (is_builtin) {
+ if (is_builtin && *name_len) {
guint8 const *str = data;
char const *builtin;
@@ -3952,6 +3952,7 @@ excel_read_NAME (BiffQuery *q, GnmXLImporter *importer, ExcelReadSheet *esheet)
sheet_index = 0; /* no sheets */
}
+ XL_NEED_BYTES (name_len);
name = excel_read_name_str (importer, data, &name_len, builtin_name);
XL_NEED_BYTES (name_len);
data += name_len;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]