diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-25 19:08:35 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-05-10 16:33:48 +0200 |
commit | 2846307b4d886aac8b6651c53aac88f7b4b72e57 (patch) | |
tree | 9d832b55ab25444f854ddd1209286523e91f1cba /writerfilter | |
parent | 63762d36c0c7c5ef8ad11c6d4c1f320ac7af9d26 (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)
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/ooxml/OOXMLStreamImpl.cxx | 20 |
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; |