[PATCH libreoffice-4-1] Related fdo#33895 add some checks against NULL derefs

Julien Nabet (via Code Review) gerrit at gerrit.libreoffice.org
Mon Jun 10 11:45:09 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/4223

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/23/4223/1

Related fdo#33895 add some checks against NULL derefs

Change-Id: I9c62a063788a494125ce8dc27748ed66022f5c48
Reviewed-on: https://gerrit.libreoffice.org/4199
Reviewed-by: Miklos Vajna <vmiklos at suse.cz>
Tested-by: Miklos Vajna <vmiklos at suse.cz>
---
M writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
1 file changed, 6 insertions(+), 1 deletion(-)



diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 205f821..fc6eb3e 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -1161,8 +1161,13 @@
 // Add the data pointed to by the reference as another property.
 void OOXMLFastContextHandler::resolveData(const OUString & rId)
 {
+    OOXMLDocument * objDocument = getDocument();
+    SAL_WARN_IF(!objDocument, "writerfilter", "no document to resolveData");
+    if (!objDocument)
+        return;
+
     uno::Reference<io::XInputStream> xInputStream
-        (mpParserState->getDocument()->getInputStreamForId(rId));
+        (objDocument->getInputStreamForId(rId));
 
     OOXMLValue::Pointer_t aValue(new OOXMLInputStreamValue(xInputStream));
 

-- 
To view, visit https://gerrit.libreoffice.org/4223
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c62a063788a494125ce8dc27748ed66022f5c48
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-1
Gerrit-Owner: Julien Nabet <serval2412 at yahoo.fr>
Gerrit-Reviewer: Miklos Vajna <vmiklos at suse.cz>



More information about the LibreOffice mailing list