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

Julien Nabet (via Code Review) gerrit at gerrit.libreoffice.org
Mon Jun 10 12:46:00 PDT 2013


I have submitted a patch for review:


To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/24/4224/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 c8af924..aae56aa 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/4224
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-0
Gerrit-Owner: Julien Nabet <serval2412 at yahoo.fr>
Gerrit-Reviewer: Miklos Vajna <vmiklos at suse.cz>

More information about the LibreOffice mailing list