[gnumeric] xls: fuzzed file fix re shared strings table.



commit 66f79b952860b59dc9d00d96bf2bd5b90e05fcb8
Author: Morten Welinder <terra gnome org>
Date:   Sat Jun 20 11:56:21 2015 -0400

    xls: fuzzed file fix re shared strings table.

 NEWS                          |    2 +-
 plugins/excel/ChangeLog       |    5 +++++
 plugins/excel/ms-excel-read.c |    4 ++++
 3 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 769783f..429f3bb 100644
--- a/NEWS
+++ b/NEWS
@@ -27,7 +27,7 @@ Morten:
          [#749236] [#749240] [#749234] [#749235] [#749271] [#749270]
          [#749424] [#749917] [#749919] [#750043] [#750044] [#750046]
          [#750811] [#750810] [#750857] [#750864] [#750862] [#750858]
-         [#751126]
+         [#751126] [#751254]
        * Make solver check linearity of model.
        * Fix xls saving of marker style.  [#749185]
        * Make compilation with clang work again.  [#749138]
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index f2943c6..23b14a1 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-20  Morten Welinder  <terra gnome org>
+
+       * ms-excel-read.c (sst_read_string): Handle errors from
+       excel_get_chars.  Fixes #751254.
+
 2015-06-16  Morten Welinder  <terra gnome org>
 
        * xlsx-read.c (xlsx_file_open): Plug leaks.
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index 0157ca3..fb90730 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -1257,6 +1257,10 @@ sst_read_string (BiffQuery *q, MSContainer const *c,
                                       q->data + offset, get_len, use_utf16, NULL);
                offset += get_len * (use_utf16 ? 2 : 1);
 
+               /* Handle corrupted string.  */
+               if (!str)
+                       str = g_strdup ("");
+
                if (res_str != NULL) {
                        old_res = res_str;
                        res_str = g_strconcat (old_res, str, NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]