[gnumeric] Lotus: fix crash with broken file.



commit f81ebeafae91e3bf4b5367a3fa199791904f0348
Author: Morten Welinder <terra gnome org>
Date:   Fri Jun 14 13:04:06 2013 -0400

    Lotus: fix crash with broken file.

 NEWS                        |    4 ++--
 plugins/lotus-123/ChangeLog |    4 ++++
 plugins/lotus-123/lotus.c   |    3 +++
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 2e92935..6eb2f39 100644
--- a/NEWS
+++ b/NEWS
@@ -58,8 +58,8 @@ Morten:
        * Introspection fixes.
        * Fix xls/biff5 link export.  [#701604]
        * Workaround problems with automake 1.13.
-       * Fix crashes on corrupted files.  [#702101] [#702182]  [#702218]
-         [#702267]
+       * Fix crashes on corrupted files.  [#702101] [#702182] [#702218]
+         [#702267] [#702277]
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.2
diff --git a/plugins/lotus-123/ChangeLog b/plugins/lotus-123/ChangeLog
index 21970ca..0d5dc56 100644
--- a/plugins/lotus-123/ChangeLog
+++ b/plugins/lotus-123/ChangeLog
@@ -1,3 +1,7 @@
+2013-06-14  Morten Welinder  <terra gnome org>
+
+       * lotus.c (lotus_read): Handle corrupted BOF.
+
 2013-04-26  Morten Welinder <terra gnome org>
 
        * Release 1.12.2
diff --git a/plugins/lotus-123/lotus.c b/plugins/lotus-123/lotus.c
index 5c457dd..7687a7d 100644
--- a/plugins/lotus-123/lotus.c
+++ b/plugins/lotus-123/lotus.c
@@ -2384,6 +2384,9 @@ lotus_read (LotusState *state)
 
        if (!record_next (&r)) return FALSE;
 
+       if (r.len < 2)
+               return FALSE;
+
        state->version = GSF_LE_GET_GUINT16 (r.data);
 
        if (r.type == LOTUS_BOF) {


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