summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-25 19:08:35 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-11-29 07:51:46 +0100
commit9a1401ff5e35622b43bdf767d5d5f1834b39269e (patch)
treeb6160503cbe7857cf6da6e190d652005a54a3fa1
parent339a22a949245397931dc3aec6031a87c2a4402d (diff)
ofz#10056 Null deref
Change-Id: I9ea0f272d0a8b13fb51fec55ac57adca47cafc77 Reviewed-on: https://gerrit.libreoffice.org/59601 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit 48c677d55330ac6caf0065fa1776c985b876eead)
-rw-r--r--writerfilter/source/ooxml/OOXMLStreamImpl.cxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
index ddb89f17b528..b7b5fa4ae3bb 100644
--- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
@@ -326,12 +326,20 @@ bool OOXMLStreamImpl::lcl_getTarget(const uno::Reference<embed::XRelationshipAcc
// simple string concatination here to handle that.
uno::Reference<uri::XUriReference> xPart = xFac->parse(sMyTarget);
uno::Reference<uri::XUriReference> xAbs = xFac->makeAbsolute(xBase, xPart, true, uri::RelativeUriExcessParentSegments_RETAIN);
- rDocumentTarget = xAbs->getPath();
- // path will start with the fragment separator. need to
- // remove that
- rDocumentTarget = rDocumentTarget.copy( 1 );
- if(sStreamType == sEmbeddingsType)
- embeddingsTarget = rDocumentTarget;
+ if (!xAbs)
+ {
+ //it was invalid gibberish
+ bFound = false;
+ }
+ else
+ {
+ rDocumentTarget = xAbs->getPath();
+ // path will start with the fragment separator. need to
+ // remove that
+ rDocumentTarget = rDocumentTarget.copy( 1 );
+ if(sStreamType == sEmbeddingsType)
+ embeddingsTarget = rDocumentTarget;
+ }
}
break;