[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Aug 30 14:59:18 UTC 2018


 writerfilter/source/ooxml/OOXMLStreamImpl.cxx |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

New commits:
commit 48c677d55330ac6caf0065fa1776c985b876eead
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Aug 25 19:08:35 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Thu Aug 30 16:58:54 2018 +0200

    ofz#10056 Null deref
    
    Change-Id: I9ea0f272d0a8b13fb51fec55ac57adca47cafc77
    Reviewed-on: https://gerrit.libreoffice.org/59601
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
index 2d96312be119..7e742690d32b 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 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;


More information about the Libreoffice-commits mailing list