[Libreoffice-commits] core.git: Branch 'libreoffice-6-4-3' - sfx2/source

Julian Kalinowski (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 1 09:38:54 UTC 2020


 sfx2/source/doc/docfile.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a9ed52fca453f14cd38d948eba749248892577e4
Author:     Julian Kalinowski <julian.kalinowski at dataport.de>
AuthorDate: Tue Mar 31 12:45:31 2020 +0200
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Wed Apr 1 11:38:23 2020 +0200

    tdf#128662 Fix exception when accessing empty lock list
    
    This fixes an Access Violation Exception when a WebDAV server says a
    resource is locked but does return an empty lockdiscovery element on
    WebDAV Propfind. Without this patch, the code only checks that a list
    exists, but it should also check if it contains elements before
    accessing it.
    
    Change-Id: I5f555a9b5805102242392b018ab5a8009c7a203c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91412
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91392
    Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
    (cherry picked from commit 37cb8ac6abfc9bfd44aed1a51f6374ad1e23583a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91396
    Reviewed-by: Julian Kalinowski <julian.kalinowski at dataport.de>
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 0e646ae723b5..5d00d39bd837 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1206,7 +1206,7 @@ SfxMedium::LockFileResult SfxMedium::LockOrigFileOnDemand(bool bLoading, bool bN
 
                                 uno::Sequence<css::ucb::Lock> aLocks;
                                 // getting the property, send a PROPFIND to the server over the net
-                                if (aContentToLock.getPropertyValue("DAV:lockdiscovery") >>= aLocks)
+                                if ((aContentToLock.getPropertyValue("DAV:lockdiscovery") >>= aLocks) && aLocks.hasElements())
                                 {
                                     // got at least a lock, show the owner of the first lock returned
                                     css::ucb::Lock aLock = aLocks[0];


More information about the Libreoffice-commits mailing list