summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-06-06 11:41:03 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-06-06 19:07:07 +0200
commit31ca5ba5150ea8fb3666d8b5da5cdbadaafedd5e (patch)
treeb41d84b5b8c5f4d179520ec2b8aba90b8dcaa983
parent97db34a3a24054f750fd5308d1927a509f10a8b5 (diff)
add some checks against NULL derefs
Change-Id: I85fbf279991ee361ea081d92d9acc84d36677af1 (cherry picked from commit fa671cecd4bb2f38a0a9171cfdbb56efddda1cfa) Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx3
-rw-r--r--writerfilter/source/ooxml/OOXMLParserState.cxx3
2 files changed, 6 insertions, 0 deletions
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 24af62c99d26..7edbaec5e60b 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -1343,6 +1343,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 7e9b474ba80c..1352d7376ef1 100644
--- a/writerfilter/source/ooxml/OOXMLParserState.cxx
+++ b/writerfilter/source/ooxml/OOXMLParserState.cxx
@@ -135,6 +135,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);
}