summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsamu Mogi <saturday6c@gmail.com>2013-06-04 13:10:44 +0000
committerLuboš Luňák <l.lunak@suse.cz>2013-06-06 13:09:49 +0000
commit6d2e3bdac27ade56031d930c85e906c0d35877bc (patch)
treeba5ed96b3269c38e5aba595fc63d4b3de7e6bcdf
parent53070b048afcc7eaf1dbe79eecadb4045e65c342 (diff)
fdo#41226 Add error handling of recursed GetCaseCorrectPathNameEx()
GetCaseCorrectPathNameEx() with bCheckExistence = true doesn't support windows share path but occasionally it doesn't return failure and returns broken result. For example, when we call with "\\USER-PC\Users\foo" then it converts the path to "\Users\foo". And when "\Users\foo" exists, it returns "\Users\foo". It is caused by missing error handling of searching for file "\\USER-PC". Also similar bug possibly occurs even for local file path. This commit fixes these bugs. Change-Id: Idf1dd1282510d8a6810ed239a83051bb0f8e2f87 Reviewed-on: https://gerrit.libreoffice.org/4151 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
-rw-r--r--sal/osl/w32/file_url.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx
index fb1fa459a61f..e9be89598768 100644
--- a/sal/osl/w32/file_url.cxx
+++ b/sal/osl/w32/file_url.cxx
@@ -486,7 +486,8 @@ static DWORD GetCaseCorrectPathNameEx(
else
bSkipThis = FALSE;
- GetCaseCorrectPathNameEx( lpszPath, cchBuffer, nSkipLevels, bCheckExistence );
+ if ( !GetCaseCorrectPathNameEx( lpszPath, cchBuffer, nSkipLevels, bCheckExistence ) )
+ return 0;
PathAddBackslash( lpszPath, cchBuffer );