diff options
author | Isamu Mogi <saturday6c@gmail.com> | 2013-06-04 13:10:44 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-06-10 09:05:08 +0000 |
commit | 0a57644fd1ac197571c69cd3bbf67ec05c98dd74 (patch) | |
tree | 3179cf51b2e8a5972fd5e6b6370f49c2f76c567e | |
parent | 3e694124efbc136058d78038d8be00cd92281662 (diff) |
fdo#41226 Add error handling of recursed GetCaseCorrectPathNameEx()
This is a cherry-pick of 6d2e3bdac27ade56031d930c85e906c0d35877bc .
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: I76ef5bcaf23252d427bd85565e7daec86978cea7
Reviewed-on: https://gerrit.libreoffice.org/4210
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
-rw-r--r-- | sal/osl/w32/file_url.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx index 2527cbde4e2f..0eb19b38967e 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 ); |