summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-25 19:08:35 +0100
committerAndras Timar <andras.timar@collabora.com>2021-10-10 22:33:56 +0200
commit5d946f7a022208bb345b85b469313eea5eb3fd57 (patch)
tree795c52a3217145d69d9545ec6c15bb3bdb62121d
parenta73d4e32716719419200c96918e7524e5f70e69b (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>
-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 f82de598a095..845d78531bad 100644
--- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
@@ -315,12 +315,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;