[gnumeric] avoid crash https://bugzilla.redhat.com/show_bug.cgi?id=971573



commit 7944c4ebc7934c37c4af674328ed01c6c4e77a0d
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu Jun 6 15:29:54 2013 -0600

    avoid crash https://bugzilla.redhat.com/show_bug.cgi?id=971573
    
    2013-06-06  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-read.c (odf_text_content_end): check for NULL
        before dereferencing to avoid fedora crash
        https://bugzilla.redhat.com/show_bug.cgi?id=971573

 plugins/openoffice/ChangeLog         |    6 ++++++
 plugins/openoffice/openoffice-read.c |    3 +++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 5f1f6c3..c9a5587 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,9 @@
+2013-06-06  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * openoffice-read.c (odf_text_content_end): check for NULL
+       before dereferencing to avoid fedora crash
+       https://bugzilla.redhat.com/show_bug.cgi?id=971573
+
 2013-04-26  Morten Welinder <terra gnome org>
 
        * Release 1.12.2
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index b4ed1a8..0523405 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -1640,6 +1640,9 @@ odf_text_content_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
        OOParseState *state = (OOParseState *)xin->user_state;
        oo_text_p_t *ptr = state->text_p_stack->data;
 
+       g_return_if_fail (ptr != NULL);
+       g_return_if_fail (xin->content != NULL);
+
        if (strlen (xin->content->str) > ptr->offset)
                odf_text_p_add_text
                        (state, xin->content->str + ptr->offset);


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