sfx2/source/doc/docfile.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 169a10f0e4680814145b668c6320be04038d7a89 Author: Julian Kalinowski <[email protected]> AuthorDate: Tue Mar 31 12:45:31 2020 +0200 Commit: Mike Kaganski <[email protected]> CommitDate: Tue Mar 31 14:02:02 2020 +0200 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. Fixes tdf#128662 Change-Id: I5f555a9b5805102242392b018ab5a8009c7a203c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91412 Tested-by: Mike Kaganski <[email protected]> Reviewed-by: Mike Kaganski <[email protected]> diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 3e103460be1b..09c6f8cbb6ed 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -1186,7 +1186,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]; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
