summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-04-22 22:07:48 +0200
committerLuboš Luňák <l.lunak@collabora.com>2021-04-22 23:46:09 +0200
commit8313e7fe55d4ad147df0b5b1f9f94c6882197132 (patch)
tree8a5cb8f2a080e2996d354e53b1c23013a908ab78
parent237446b38631c2a40c227e96f7f8c30b9c3932b4 (diff)
handle properly missing URI components for webdav/serf
Username is not mandatory for http://, and files require only path. Change-Id: Iab4e81692b288d17dd8a35954e34a1bbe7c943ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114526 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--ucb/source/ucp/webdav/SerfUri.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/ucb/source/ucp/webdav/SerfUri.cxx b/ucb/source/ucp/webdav/SerfUri.cxx
index 8852779faeba..c48b4f254b72 100644
--- a/ucb/source/ucp/webdav/SerfUri.cxx
+++ b/ucb/source/ucp/webdav/SerfUri.cxx
@@ -90,9 +90,9 @@ SerfUri::SerfUri( const OUString & inUri )
void SerfUri::init( const apr_uri_t * pUri )
{
- mScheme = OStringToOUString( pUri->scheme, RTL_TEXTENCODING_UTF8 );
- mUserInfo = OStringToOUString( pUri->user, RTL_TEXTENCODING_UTF8 );
- mHostName = OStringToOUString( pUri->hostname, RTL_TEXTENCODING_UTF8 );
+ mScheme = pUri->scheme ? OStringToOUString( pUri->scheme, RTL_TEXTENCODING_UTF8 ) : "";
+ mUserInfo = pUri->user ? OStringToOUString( pUri->user, RTL_TEXTENCODING_UTF8 ) : "";
+ mHostName = pUri->hostname ? OStringToOUString( pUri->hostname, RTL_TEXTENCODING_UTF8 ) : "";
mPort = pUri->port;
mPath = OStringToOUString( pUri->path, RTL_TEXTENCODING_UTF8 );