[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - writerfilter/source

Caolán McNamara caolanm at redhat.com
Thu Jun 6 10:21:20 PDT 2013


 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |    3 +++
 writerfilter/source/ooxml/OOXMLParserState.cxx        |    3 +++
 2 files changed, 6 insertions(+)

New commits:
commit 098819a289651793d4dc198dfb0a044ff723893f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 6 11:41:03 2013 +0100

    add some checks against NULL derefs
    
    (cherry picked from commit fa671cecd4bb2f38a0a9171cfdbb56efddda1cfa)
    
    Change-Id: I85fbf279991ee361ea081d92d9acc84d36677af1
    Signed-off-by: Miklos Vajna <vmiklos at suse.cz>

diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 5865846..c8af924 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -1335,6 +1335,9 @@ void OOXMLFastContextHandlerProperties::lcl_endFastElement
     {
         if (isForwardEvents())
         {
+            SAL_WARN_IF(!mpStream, "writerfilter", "no stream to set properties on");
+            if (!mpStream)
+                return;
             mpStream->props(mpPropertySet);
         }
     }
diff --git a/writerfilter/source/ooxml/OOXMLParserState.cxx b/writerfilter/source/ooxml/OOXMLParserState.cxx
index 45f8b1c..723aef8 100644
--- a/writerfilter/source/ooxml/OOXMLParserState.cxx
+++ b/writerfilter/source/ooxml/OOXMLParserState.cxx
@@ -125,6 +125,9 @@ OOXMLDocument * OOXMLParserState::getDocument() const
 
 void OOXMLParserState::setXNoteId(const sal_Int32 nId)
 {
+    SAL_WARN_IF(!mpDocument, "writerfilter", "no document to set note id on");
+    if (!mpDocument)
+        return;
     mpDocument->setXNoteId(nId);
 }
 


More information about the Libreoffice-commits mailing list