writerfilter/source/ooxml/OOXMLStreamImpl.cxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
New commits: commit a48b5c8e85159485e175bdcd1dea7e30948f9fc4 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Aug 25 19:08:35 2018 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat Aug 25 22:21:57 2018 +0200 ofz#10056 Null deref Change-Id: I9ea0f272d0a8b13fb51fec55ac57adca47cafc77 Reviewed-on: https://gerrit.libreoffice.org/59596 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx index 7a1b353cba64..e4e53acc8f1f 100644 --- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx @@ -316,12 +316,20 @@ bool OOXMLStreamImpl::lcl_getTarget(const uno::Reference<embed::XRelationshipAcc // simple string concatenation 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits